• 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.

Develop a dll

Messages
14
Country
italy
Greetings to all
Anyone knows how to develop a dll for FSX with VS2005 (.Net)?

I read something in the SDK documentation but I don't understand which method name I have to use to have FSX call my functions...

Anyone knows or has a sample?
Thanks
 
Hi,

Did you read the SimConnect SDK? The first part explains how to make your DLL/EXE project and also how to edit the XML files so that FSX will load it.
 
Yes...I've read.
It speaks about a definition file, but I'm not sure if it refers to .Net environment (I don't find such a thing in VS2005).

And go on by tries is not my preferred way :confused:
 
In VS 2005 you select the type of project that you want to make. From File -> New Project select Class Library. This will produce a dll.

Bear in mind that to test it you will need to add another project to the solution that has some sort of user interface. If your Class Library is set as the Start Up Project you will get an error. So once you have created your Class Library Project then add another Project to the Solution either Console or Windows Application. Set this to be the Start Up Project and make a reference to your class Library (dll). You should then be good to go.

As for how you interface with FSX you need to get that from the SDK as Arno suggests
 
hmm...sorry but...maybe I have a problem to explain my issue.

Try to explain it, step by step:
1. I want to create an addon for FSX, and I want it'll be a dll (because I want some "hide" functionalities...)

2. So, I opened VS2005, create a class library project, add my required references...ok

3. Now...I suppose that if I want FSX uses my dll, I have to configure dll.xml (ok) and then start FSX

yes but...how FSX initialize my dll? I think it'll looks for a specific method (am I wrong or the SDK speaks about a DllStart and DllStop?).

But as you can see, I'm a bit confused on this...anything else (such adding another assembly with user interface or other feature is not my issue...I just want to accomplish the development of a class library for FSX by now...)

...and thanks for your help/attention ;)
 
OK maybe someone else will be able to help you. I have not done any work on dll's inside FSX, only communicating via SimConnect.
 
Hi,

Maybe we should first ask you what kind of program you are trying to make. Does it communicate with FSX using SimConnect or is there some other integration you have in mind.

If you are using SimConnect, then running it as a EXE or DLL in the background that is called with the exe.xml or dll.xml file should be enough. In that case you should initialize the SimConnect connection when the tool starts and that should be enough. So your tool (the client) is calling FSX (the server) and requests information. So FSX does not need to know more about your tool to initialize.
 
I've already done an application (exe) for FSX.
It starts when FSX starts ('cause I configured so in exe.dll file), then the user have to click "Connect" button on my app form and then begin using the application...and this works.

Now I want to change a bit how my application: I don't want user to click "Connect" button and more over, I don't want my application has a form...all will be done from FSX menù.

So...I have to change my application from exe to dll (an this ok...), then add an AddMenuItem/AddMenuSubItem layer to have my application add a menù after connected to FSX.

Ok that's all.

Well...not...

If I'm able to configure my dll to start when FSX starts (by dll.xml file), I don't know which method will be called first (an entry point)...so my dll starts up then...nothing :(

The only thing I miss is the entry point name.

Right?
Or am I missing anything?
 
If I'm able to configure my dll to start when FSX starts (by dll.xml file), I don't know which method will be called first (an entry point)...so my dll starts up then...nothing :(

The only thing I miss is the entry point name.

Right?
Or am I missing anything?

DLLStart is the entry. DLLStop is called for you to tidy up on closure.

You seem to have missed actually reading the SimConnect SDK documentation, which not only shows you exactly how to define the DLLStart and DLLStop routines (with pictures even) so that SimConnect can find them, but even gives and example of their use (in the section on Simconnect_CallDispatch).

Just do a search in the documentation for DLLStart and you will find all the information you could possibly need!

Pete
 
What kind of project are you using?

Unless you want to do some lowlevel hacking, DLL produced in a managed environment can't be used, since you can't add the Start/Stop functions.

You will have to use develop an unmanaged C++ DLL, with C# it's (almost) not possible. You'll have to wrap the DLL in an unmanaged DLL.

Daniel
 
What kind of project are you using?

Unless you want to do some lowlevel hacking, DLL produced in a managed environment can't be used, since you can't add the Start/Stop functions.

You will have to use develop an unmanaged C++ DLL, with C# it's (almost) not possible. You'll have to wrap the DLL in an unmanaged DLL.

Daniel

Sad to hear that...so is it not possible in managed environment?

So...what I guess from SDK (I read SimConnect_CallDispatch and other documentation...) was true...it's not possible in C#/VB.Net...
:eek::(:mad:

Maybe wrap the managed dll will be my way...but I thought a simpler way...:speanut:
 
Trust me you don't need a managed dll.

Just do a formless managed application (in fact, a form application that doesn't show the form) like this

Code:
static class Program
{
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Form1 ola = new Form1();
            Application.Run();
        }
}

hook the exe to fs start by using exe.xml file.

In my site you can find several source code files that will allow you to connect to fsx without any "connect button".

It's an old habit in fs: do dll. Why people still do that (except in some particular case) beats me.

José
 
Trust me you don't need a managed dll.

Just do a formless managed application (in fact, a form application that doesn't show the form) like this

Code:
static class Program
{
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Form1 ola = new Form1();
            Application.Run();
        }
}

hook the exe to fs start by using exe.xml file.

In my site you can find several source code files that will allow you to connect to fsx without any "connect button".

It's an old habit in fs: do dll. Why people still do that (except in some particular case) beats me.

José

Hey...wow!
This is an illuminating solution! ;):D

Thanks a lot...I was just stuck with call managed from unmanaged...this seems a simper way :o
 
Back
Top