- Messages
- 22
- Country
-
Hello Simmers and Developers.
After 2 years im now back in the flight simulation world. And I try now to build my own "small" homecockpit for my favourite aircraft the PMDG 737NGX. After searching for SDK for the NGX i found out really fast that the PMDG delivers SDK. So I downloaded Visual Studio 2013, because I have read that SimConnect only works up to this version of IDE) and installed on my PC. As well i put my Disk 1 vom my FSK Gold Edition in my PC and install the SDK for the FSX. As installpath i used my external hard drive for my fsx.
Then i started Visual Studio and creating an new Win32 Console Application, with pre compiled headers. A quick "Hello World" cout test code works fine so now to the SimConnect SDK.
That is what I did to link to my SimConnect files/dll/library:
1) Unter Project / Properties / C/C++ Linker I add the SimConnect Header File(SDK/Core .../SimConnect SDK/inc)
2) Now under Linker / General I add the Additional Library to the SimConnect Library File(SimConnect SDK/lib)
3) Linker / Input I add the SimConnect.lib under Additional Dependencies
And I add unter the command line in the Linker Section "/INCREMENTAL" to get rid of one warning.
Then i import the PMDG Test Connection cpp file to my project after compiling I good same errors. Most of them are "undeclared identifier" and "function does not take 6 arguments".
That are the lines with errors:
Undeclared identifier joins on "SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET" and "SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED". And on the functions "SimConnect_AddToClientDataDefinition" the last zero is underlined red. After same reseraching on the Internet I found a post on this Forum to solve this problem, but not for me!
The lines with the addtoclientdatadefinition changes to this:
And the two lines with the too many arguments changes to this:
Now i can compile my Project and run it. When i stand with the 737NGX on a airport and run the application then i got an message that says that the program successfully connected to FS. Followed by this 5 messages on the console:
Every thing is good. I press the keys that are programmed like(Ctrl+Shift+B) is in this example to turn on the Logo Light works fine!
But the NGX does not respond to any Data Change Events. Example an Message in Console should came if I switch the taxi light, but the message never cames. Also if I switch the Fuelpump switchs no messages. So i think there is samething wrong with the changed Code lines, that gives me the errors with too many arguments and undeclared identifier. When I add an debug message with printf in the "ProcessNGXData()" function this debug message will never display on the console.
So now what is wrong?
Has samebody else this problem too? And know how to fix it?
Good evening, Jan
After 2 years im now back in the flight simulation world. And I try now to build my own "small" homecockpit for my favourite aircraft the PMDG 737NGX. After searching for SDK for the NGX i found out really fast that the PMDG delivers SDK. So I downloaded Visual Studio 2013, because I have read that SimConnect only works up to this version of IDE) and installed on my PC. As well i put my Disk 1 vom my FSK Gold Edition in my PC and install the SDK for the FSX. As installpath i used my external hard drive for my fsx.
Then i started Visual Studio and creating an new Win32 Console Application, with pre compiled headers. A quick "Hello World" cout test code works fine so now to the SimConnect SDK.
That is what I did to link to my SimConnect files/dll/library:
1) Unter Project / Properties / C/C++ Linker I add the SimConnect Header File(SDK/Core .../SimConnect SDK/inc)
2) Now under Linker / General I add the Additional Library to the SimConnect Library File(SimConnect SDK/lib)
3) Linker / Input I add the SimConnect.lib under Additional Dependencies
And I add unter the command line in the Linker Section "/INCREMENTAL" to get rid of one warning.
Then i import the PMDG Test Connection cpp file to my project after compiling I good same errors. Most of them are "undeclared identifier" and "function does not take 6 arguments".
That are the lines with errors:
Code:
// Define the data area structure - this is a required step
hr = SimConnect_AddToClientDataDefinition(hSimConnect, PMDG_NGX_DATA_DEFINITION, 0, sizeof(PMDG_NGX_Data), 0, 0);
// Sign up for notification of data change.
// SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED flag asks for the data to be sent only when some of the data is changed.
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);
// Define the control area structure - this is a required step
hr = SimConnect_AddToClientDataDefinition(hSimConnect, PMDG_NGX_CONTROL_DEFINITION, 0, sizeof(PMDG_NGX_Control), 0, 0);
// Sign up for notification of control change.
hr = SimConnect_RequestClientData(hSimConnect, PMDG_NGX_CONTROL_ID, CONTROL_REQUEST, PMDG_NGX_CONTROL_DEFINITION,
SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED, 0, 0, 0);
Undeclared identifier joins on "SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET" and "SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED". And on the functions "SimConnect_AddToClientDataDefinition" the last zero is underlined red. After same reseraching on the Internet I found a post on this Forum to solve this problem, but not for me!
The lines with the addtoclientdatadefinition changes to this:
Code:
hr = SimConnect_AddToClientDataDefinition (hSimConnect, PMDG_NGX_DATA_DEFINITION, 0, 0, 0);
hr = SimConnect_AddToClientDataDefinition (hSimConnect, PMDG_NGX_CONTROL_DEFINITION, 0, 0, 0);
And the two lines with the too many arguments changes to this:
Code:
hr = SimConnect_RequestClientData(hSimConnect, PMDG_NGX_DATA_ID, DATA_REQUEST, PMDG_NGX_DATA_DEFINITION, 0, 0);
Now i can compile my Project and run it. When i stand with the 737NGX on a airport and run the application then i got an message that says that the program successfully connected to FS. Followed by this 5 messages on the console:
Code:
Connected to Flight Simulator!
Received:2
Received:1
Received:1
Received:1
Received:1
Every thing is good. I press the keys that are programmed like(Ctrl+Shift+B) is in this example to turn on the Logo Light works fine!
But the NGX does not respond to any Data Change Events. Example an Message in Console should came if I switch the taxi light, but the message never cames. Also if I switch the Fuelpump switchs no messages. So i think there is samething wrong with the changed Code lines, that gives me the errors with too many arguments and undeclared identifier. When I add an debug message with printf in the "ProcessNGXData()" function this debug message will never display on the console.
So now what is wrong?
Has samebody else this problem too? And know how to fix it?
Good evening, Jan