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

FSX User guide with examples

Messages
6
Country
brazil
I'm beginner on development with SimConnect, so I wanted a specific document, that could help me manipulate events with FSX, or that simply works well, because I have seen many examples but none work right, always missing files as SimConnect.h or <strsave.h> etc.
This forum is my last chance. :confused:
 
I don't think there is one as of yet. The basic setup of Visual Studio to include SimConnect.h and SimConnect.lib can be found on the forum, however, I will go ahead and repeat the steps:

-Select Project / Properties.

In this window:
-Find Configuration Properties / General. Confirm that either .dll or .exe is selected depending on what kind of module you want to write.

-Find C/C++ / General. Select Additional Include Directories, use <edit>, and add a new directory of .../SDK/Core Utilities Kit/SimConnect SDK/inc (actually navigate to that folder on your PC)

-Find Linker / General. Select Additional Library Directories, add Simconnect SDK/lib

-Find Linker / Input. Select Additional Dependencies and add SimConnect.lib


The VS should be more or less set up for work. Let us know further if something does not work. I will be posting a project source this weekend after I clean it up. You can then try it yourself.

One more thing, if you want to write a DLL, head the SDK recommendations and make sure your .def file is as it should be.
 
I did exactly as you said and still not working, I know the only reason is because I have no experience with C + +, only worked many years with VB6.

Below I describe what I'm doing:
- Started PMDG_NGX_ConnectionTest.cpp the file in Visual Studio 2005 (C + +).
- I did all the configuration specified by you.
- I clicked build PMDG_NGX_ConnectionTest.

* Result: many errors. I guess I've got it wrong do not even know what is the file that opens the project in VS 2005.

For now I will continue studying C + +. My real intention is just to run the example of PMDG SDK, so I can better understand the flow of a project. So if someone can make this work and make the project. Zip this project here, with some instruction on how to load / compile the project, it would be exactly what I need.

I'll be anxiously awaiting your source code.
 
Last edited:
I have not tried the PMDG SDK yet, but I plan to. I just love what Aerosoft did with their FDR, and think of maybe over the months writing something similar for NGX (bit by bit).

As for what to do - try this: Do not open the cpp file, that is just a part of the whole project.

Instead, start a new project. Select Win32 Console application, and set it up as described in FSX SDK. Go ahead now, and copy the .h file in, and add it via rightclick on Headers (in Solution Explorer in VS), Add, Existing.

Then open your main .cpp file and copy contents from PMDG .cpp file over. Note that PMDG .cpp file is set up for .exe method, not .dll method (as described in FSX SDK). Build your exe, and if you are successful, set up SimConnect console and/or logging (via SimConnect.ini, as described in FSX SDK), put your exe in exe.xml, and start the simulator. Watch the console window and watch whether your exe is loaded, and interfacing...
 
After your orientation, it seems that now the project could mount correctly, however still has an error when compiling. I guess I'm close to solving the problem. See the source code PMDG_SDK_ConnectionTest.zip (2.9 MB). I don't attached the file because it took too long to make a upload.
 
Last edited:
Never mind, managed to download it.

Why did you include ESP SimConnect instead of FSX one? If I change the ESP SimConnect for FSX one, I throw no more errors.
 
I really want it, that works well ... It's okay if I have to change what I will include, because in truth, logic is on ccp file. What I have to do to use the FSX one? could you show me the project going? thanks one more time.
 
Hello, you copied a "simconnect.h" file from an SDK, I suppose, that is not an FSX SDK but rather an ESP SDK. ESP is the "commercial version of FSX engine" and it uses the SimConnect as well, but it is a bit different version.

Find the SimConnect.h in \Microsoft Flight Simulator X SDK\SDK\Core Utilities Kit\SimConnect SDK\inc\ instead, and copy that to your project.


(I suppose you are NOT in actuality using ESP, are you?)

I could upload the project, by my VS2010 re-formated it from an earlier version, so I dont think your VS will open it. But I did not change one thing but the file anyway.
 
Ok, I'll say exactly what I'm using.

SimConnect SDK Reference

In this version, the method SimConnect_AddToClientDataDefinition have 6 parameters, like below:
Code:
SIMCONNECTAPI SimConnect_AddToClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, DWORD dwOffset, DWORD dwSizeOrType, float fEpsilon = 0, DWORD DatumID = SIMCONNECT_UNUSED);

And SinConnect.h of ...\Microsoft Flight Simulator X SDK\SDK\Core Utilities Kit\SimConnect SDK\inc, have only 5 parameters, like below:
Code:
SIMCONNECTAPI SimConnect_AddToClientDataDefinition(HANDLE hSimConnect, SIMCONNECT_CLIENT_DATA_DEFINITION_ID DefineID, DWORD dwOffset, DWORD dwSize, DWORD dwReserved = SIMCONNECT_UNUSED);

Even if I replace the methods, many other errors appear then. Can you post the link to your SimConnect.h, so I could test it.
 
Yes, that is the ESP SDK hosted on MSDN. A bit different, as I said.

The SimConnect.h file is a part of FSX SDK, you can find the SDK on your FSX installation disks. I do believe you did install the FSX SDK?
 
@pfabian, thanks a lot for help me, now everything works fine, but I have made some changes on my .cpp file, like below:

Code:
//hr = SimConnect_AddToClientDataDefinition (hSimConnect, PMDG_NGX_CONTROL_DEFINITION, 0, sizeof(PMDG_NGX_Control), 0, 0);
hr = SimConnect_AddToClientDataDefinition (hSimConnect, PMDG_NGX_CONTROL_DEFINITION, 0, 0, 0);

Code:
//hr = SimConnect_RequestClientData(hSimConnect, PMDG_NGX_DATA_ID, DATA_REQUEST, PMDG_NGX_DATA_DEFINITION, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED, 0, 0, 0);
hr = SimConnect_RequestClientData(hSimConnect, PMDG_NGX_DATA_ID, DATA_REQUEST, PMDG_NGX_DATA_DEFINITION, 0, 0);
 
Back
Top