View Full Version : How to write an FS module
10 Jun 2007, 14:33
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.
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.
10 Jun 2007, 17:34
I suggest you read this:
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.
10 Jun 2007, 20:19
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.
11 Jun 2007, 04:06
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.
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.