Hi (sorry in advance for my bad english),
I'm trying to get the flying state value toward the SimConnect_RequestSystemState() funtion.
The funtion doesn't return any error, but the value of the flying state is always 0 no matter what, even when I'm currently flying.
This is the code :
------------------------------------------------------------------
HANDLE ScDefaultHandle;
char* szState;
szState=strdup("Sim");
SIMCONNECT_RECV_SYSTEM_STATE fsxStateStruct;
SIMCONNECT_RECV fsxStateTempStruct;
SIMCONNECT_RECV_ID fsxStateStructType = SIMCONNECT_RECV_ID_SYSTEM_STATE;
fsxStateTempStruct.dwID = fsxStateStructType; //only used to refresh the dwID attribute in order to //receive the returned structure by the SimConnect_RequestSystemState() funtion.
SIMCONNECT_DATA_REQUEST_ID fsxRequestStateID;
fsxRequestStateID=7777;
fsxStateStruct.dwRequestID=fsxRequestStateID;
SimConnect_RequestSystemState(ScDefaultHandle, fsxRequestStateID, szState);
cout<<"Flying state = "<<fsxStateStruct.dwInteger<<endl; //0 or 1 (but in my case, it's always 0)
------------------------------------------------------------------
So, shouldn't the fsxStateStruct.dwInteger attribute be correct ? What is wrong in this code ? I though I had respected all the points specified in the big SimConnect documentation... A bit disapointed
I had to regroup all those lines, because they was all dispatched here and there in the code. So maybe I did a mistake in the order of the lines ? Maybe the fsxStateTempStruct.dwID refreshing isn't at the good moment in the code ?
Thanks in advance for your help.
Regards
I'm trying to get the flying state value toward the SimConnect_RequestSystemState() funtion.
The funtion doesn't return any error, but the value of the flying state is always 0 no matter what, even when I'm currently flying.
This is the code :
------------------------------------------------------------------
HANDLE ScDefaultHandle;
char* szState;
szState=strdup("Sim");
SIMCONNECT_RECV_SYSTEM_STATE fsxStateStruct;
SIMCONNECT_RECV fsxStateTempStruct;
SIMCONNECT_RECV_ID fsxStateStructType = SIMCONNECT_RECV_ID_SYSTEM_STATE;
fsxStateTempStruct.dwID = fsxStateStructType; //only used to refresh the dwID attribute in order to //receive the returned structure by the SimConnect_RequestSystemState() funtion.
SIMCONNECT_DATA_REQUEST_ID fsxRequestStateID;
fsxRequestStateID=7777;
fsxStateStruct.dwRequestID=fsxRequestStateID;
SimConnect_RequestSystemState(ScDefaultHandle, fsxRequestStateID, szState);
cout<<"Flying state = "<<fsxStateStruct.dwInteger<<endl; //0 or 1 (but in my case, it's always 0)
------------------------------------------------------------------
So, shouldn't the fsxStateStruct.dwInteger attribute be correct ? What is wrong in this code ? I though I had respected all the points specified in the big SimConnect documentation... A bit disapointed
I had to regroup all those lines, because they was all dispatched here and there in the code. So maybe I did a mistake in the order of the lines ? Maybe the fsxStateTempStruct.dwID refreshing isn't at the good moment in the code ?
Thanks in advance for your help.
Regards

