SimConnect_RequestGroundInfo() - no results
-
- Lockheed Martin
- Posts: 341
- Joined: Thu Jan 12, 2012 7:05 pm
-
- Lockheed Martin
- Posts: 341
- Joined: Thu Jan 12, 2012 7:05 pm
Mike,
I tried to follow the example with the ExternalSim earlier and here's another thread I opened for that a while ago: http://www.prepar3d.com/forum-5/?mingle ... opic&t=601 Unfortunately, the thread stopped there and I couldn't get it to work. I receive other events I'm subscribed to - not the sim_simulate though.
Short: I couldn't get the callback to work inside my own DLL, connecting via SimConnect (connection method is TCP/IP V4).
Regards,
DevSim
I tried to follow the example with the ExternalSim earlier and here's another thread I opened for that a while ago: http://www.prepar3d.com/forum-5/?mingle ... opic&t=601 Unfortunately, the thread stopped there and I couldn't get it to work. I receive other events I'm subscribed to - not the sim_simulate though.
Short: I couldn't get the callback to work inside my own DLL, connecting via SimConnect (connection method is TCP/IP V4).
Regards,
DevSim
-
- Lockheed Martin
- Posts: 341
- Joined: Thu Jan 12, 2012 7:05 pm
Ok, I'm a little confused. Your other thread implies your dispatch callback function never gets called, but here you say you are actually receiving at least some events. My suggestion would be to investigate any differences between your implementation and the sample, which appears to handle your scenario appropriately as far as I can tell.
Mike
Mike
Sorry, I wasn't 100% accurate in my statement.
What works: SimConnect_CallDispatch() from my own loop
What didn't work: Getting called by after registering the callback routine.
Might it be an issue, that my code runs in its own DLL, implemented in a C++ class within my own namespace? Or is the callback only being called if the DLL is loaded via DLL.XML on the machine running P3D?
Regards
DevSim
What works: SimConnect_CallDispatch() from my own loop
What didn't work: Getting called by after registering the callback routine.
Might it be an issue, that my code runs in its own DLL, implemented in a C++ class within my own namespace? Or is the callback only being called if the DLL is loaded via DLL.XML on the machine running P3D?
Regards
DevSim
-
- Lockheed Martin
- Posts: 341
- Joined: Thu Jan 12, 2012 7:05 pm
Here's what I just tried:
- I added the E.S.F.O Aircraft and selected it.
- I disabled the ExternalSimModule parameters in sim.cfg
- I compiled my externally running SimConnect dll with the same GUID as per sim.cfg
- I connected and registered as an external sim (SUCCESS) via TCP/IP v4
- I registered my static callback routine (SUCCESS)
- I didn't get a single call to the callback routine
- I got exceptions for all other SimConnect calls which I left as previously
I think I'm doing something wrong.
- I added the E.S.F.O Aircraft and selected it.
- I disabled the ExternalSimModule parameters in sim.cfg
- I compiled my externally running SimConnect dll with the same GUID as per sim.cfg
- I connected and registered as an external sim (SUCCESS) via TCP/IP v4
- I registered my static callback routine (SUCCESS)
- I didn't get a single call to the callback routine
- I got exceptions for all other SimConnect calls which I left as previously
I think I'm doing something wrong.
Following up on SIMCONNECT_DATATYPE_INITPOSITION: I added this to the example code from ExternalSim.cpp upon receving on the create notification.
1st:
Code:
SimConnect_AddToDataDefinition(g_hSimConnect, INIT_DEF, "Initial Position", "NULL", SIMCONNECT_DATATYPE_INITPOSITION, 0);
2nd:
Code:
SIMCONNECT_DATA_INITPOSITION Init;
Init.Altitude = 5000.0;
Init.Latitude = 47.64210;
Init.Longitude = -122.13010;
Init.Pitch = 0.0;
Init.Bank = 0.0;
Init.Heading = 180.0;
Init.OnGround = 1;
Init.Airspeed = 0;
SimConnect_SetDataOnSimObject(g_hSimConnect, INIT_DEF, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(Init), &Init );
SimConnect_AddToDataDefinition() throws SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED followod by IMCONNECT_EXCEPTION_BLOCK_TIMEOUT.
What is SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED complaining about?
1st:
Code:
SimConnect_AddToDataDefinition(g_hSimConnect, INIT_DEF, "Initial Position", "NULL", SIMCONNECT_DATATYPE_INITPOSITION, 0);
2nd:
Code:
SIMCONNECT_DATA_INITPOSITION Init;
Init.Altitude = 5000.0;
Init.Latitude = 47.64210;
Init.Longitude = -122.13010;
Init.Pitch = 0.0;
Init.Bank = 0.0;
Init.Heading = 180.0;
Init.OnGround = 1;
Init.Airspeed = 0;
SimConnect_SetDataOnSimObject(g_hSimConnect, INIT_DEF, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(Init), &Init );
SimConnect_AddToDataDefinition() throws SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED followod by IMCONNECT_EXCEPTION_BLOCK_TIMEOUT.
What is SIMCONNECT_EXCEPTION_NAME_UNRECOGNIZED complaining about?
-
- Lockheed Martin
- Posts: 341
- Joined: Thu Jan 12, 2012 7:05 pm
Hi Mike,
If the SimConnect_AddToDataDefinition() call throws, the init must throw, and yes, it did too.
I worked from the compiled ExternalSim.cpp, loaded it completely as in the SDK. It worked 100%. Then I removed the dll loading from the sim.cfg and compiled ExternalSim.cpp as an external standalone EXE. Then as described.
Next I'll try to load the new code via the sim.cfg as a DLL....
If the SimConnect_AddToDataDefinition() call throws, the init must throw, and yes, it did too.
I worked from the compiled ExternalSim.cpp, loaded it completely as in the SDK. It worked 100%. Then I removed the dll loading from the sim.cfg and compiled ExternalSim.cpp as an external standalone EXE. Then as described.
Next I'll try to load the new code via the sim.cfg as a DLL....