Hi folks,
I'm having some issue with reliability of client data areas using SimConnect in C.
What I've got are several C structs of custom variables in my aircraft (which has a Simconenct client running in a gauge) that I trying to pass several times a second to an external win32 application, which draws gauges using GDI.
However, I frequently find that SimConnect will suddenly stop sending the data areas to the win32 client. I have to restart the application to get it to continue. Also once the problem starts, it only gets worse with sunsequent restarts (of my app, not FSX) so I wonder if there's some kind of resource leak in FS or problem with a client trying to reconnect to areas previously defined?
Also, I'm setting the frequency parameter in the SimConnect_RequestClientData() function to SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET. And I am adding the wole of the struct to a client area definition with a single SimConnect_AddToClientDataDefinition() call.
(This is done in both the aircraft's generating client and the win32 app's receiving client. But I only call SimConnect_CreateClientData() in the aircraft.)
Is this the right way to go about it? Done this way, should the SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET period mean that the area is passed everytime I execute a SimConnect_SetClientData() on that area? Or is there a subtlety I'm missing?
What happens is that my inline (no callback) SimConnect_RequestClientData() calls in the win32 client stop receiving notifications and the function just returns E_FAIL all the time. I know the SimConnect connection is still "live" as I can send events from my app to the aircraft and see them take effect.
Cheers,
Si
I'm having some issue with reliability of client data areas using SimConnect in C.
What I've got are several C structs of custom variables in my aircraft (which has a Simconenct client running in a gauge) that I trying to pass several times a second to an external win32 application, which draws gauges using GDI.
However, I frequently find that SimConnect will suddenly stop sending the data areas to the win32 client. I have to restart the application to get it to continue. Also once the problem starts, it only gets worse with sunsequent restarts (of my app, not FSX) so I wonder if there's some kind of resource leak in FS or problem with a client trying to reconnect to areas previously defined?
Also, I'm setting the frequency parameter in the SimConnect_RequestClientData() function to SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET. And I am adding the wole of the struct to a client area definition with a single SimConnect_AddToClientDataDefinition() call.
(This is done in both the aircraft's generating client and the win32 app's receiving client. But I only call SimConnect_CreateClientData() in the aircraft.)
Is this the right way to go about it? Done this way, should the SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET period mean that the area is passed everytime I execute a SimConnect_SetClientData() on that area? Or is there a subtlety I'm missing?
What happens is that my inline (no callback) SimConnect_RequestClientData() calls in the win32 client stop receiving notifications and the function just returns E_FAIL all the time. I know the SimConnect connection is still "live" as I can send events from my app to the aircraft and see them take effect.
Cheers,
Si