• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

How to write an FS module

Messages
639
Country
panama
I would like to get some pointers as to how to write a module for FS (FS9/FSX), that would be a DLL that runs as part of the simulator.

Then the logical question for me would also be, is it possible to write such a DLL in C# rather than C++ ? and if not, perhaps a C++ bootstrap that would invoke functionality of another DLL which is written in C#? that assuming I can use Visual C++ 2005 Express.
 
Hi,

As far as I know most part of the modules is C code, don't think it is possible to use C# (or any other managed code). Have a look around this forum (I moved this post into the tools programming forum), there are some other threads about this subject.
 
Calling C# code from C++

Hi LoW,

I suggest you read this:
http://www.dotnet247.com/247reference/msgs/20/103481.aspx

It suggests two options for calling managed C# code.
1) Use TLBExp to export C# classes as COM objects. (Not all C# classes can
be exported to COM)
2) Compile C++ code that need to call any .NET classes with the /CLR
compiler option (compile to managed code - MSIL). Then use #using
"<AssemblyName>.dll" to reference the .NET assembly, and simply use the .NET classes using C++ with the Managed Extensions.

If your programming primarily in C#, I don't see why you would want to do that.

If your programming primarily in C++ and wanted to use classes that were written to a C# assembly, then you would want to do this.

FlapsOut
 
Just put FSX launching the exe. If you do a managed program without forms it will work just like a dll. Unless you are trying to do things that need to be in FS env.

José
 
RE: Writing an FS module

Well, I wouldn't want to use C++. I have used it a lot in the past but nowadays I am a C# guy and I typically don't like to look back. So it was not why I wanted to do it but how would I do it if I were FORCED to do it.

The reason behind all this is that I am writing an add-on in managed code. I can connect to FS and monitor things but it does have a form. I need the form to pop up in the cockpit so that the user can interact with my add-on. That was why I need(ed) to find out how I could do that.

At the moment it is just FS9 but when it is done I will make the necessary changes to make it FSX compatible as well.
 
Back
Top