Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi there,

I am investigating how to create a new FS2004 module using C#.

Does anyone can help me and show me /link me an example ?

Thank you.

Regards,

Bruno Falcão

Posted

There are very good examples in the C# .NET SDK, available as part of the FSUIPC SDK.

I'd suggest you download the SDK, look at the libraries, and the examples provided.

Posted

Indeed they are but the example to create a new module (and show a popup window) is made in C.

Also, I saw a post here about someone who developped in Delphi.

But I want to do it in C#Can anyone help me ?

Thanks in advance.

Posted

Hi,

I made some progresses in the C example, but I have a doubt.

BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)

{

switch (fdwReason) {

case DLL_PROCESS_ATTACH:

hFSimWindow = FindWindow("FS98MAIN", NULL);

oldWndProc = (WNDPROC)SetWindowLong(hFSimWindow, GWL_WNDPROC, (LONG)FSimWindowProc);

break;

}

return TRUE;

}

Does anyone knows how to refer the entry point on the C# DLL based on that code ?

Regards,

Posted

You can't load a C# based DLL inside of Flight Sim, it has no knowledge of things Managed/CLR. That's why the FSUIPC example of a loadable module is only in C, because it has to be a standard PE format DLL, not a managed one, in order to load inside FS.

The reason someone was able to do the same with Delphi is because it still generates standard PE format DLLs - you can basically use any langauge that generates standard PE format DLLs, heck back in FS95 & FS98 several of the standard FS modules were still written in assembler :->

Tim

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.