Hi,
(sorry in advance for my english)
I'm trying to get the data according to the flying simulation state :
"If 1 is returned, the user is in control of the aircraft (he's playing), if 0 is returned, the user is navigating the UI (he's not playing)."
According to this very complete source : https://msdn.microsoft.com/en-us/library/cc526983.aspx ,
(the following indexes 4) 3) etc... were made for the indexed code at the bottom. Ignore those at the 1st reading.)
-----------------------------
4)This state can be acquired by using the SimConnect_RequestSystemState() funtion.
Prototype :
HRESULT SimConnect_RequestSystemState(
HANDLE hSimConnect,
SIMCONNECT_DATA_REQUEST_ID RequestID,
const char* szState,
);
RequestID - is the "variable" which is SIMCONNECT_DATA_REQUEST_ID typed, that I have to declare myself, and then give it to the funtion.
(I call it variable because it's not defined anywhere in the documentation)
szState - is the variable which is const char* typed, that I have to declare myself aswell (and initialize it with the value "Sim" in order to get the simulation flying state in real time), and then give it to the funtion.
"The information requested will be returned in a SIMCONNECT_RECV_SYSTEM_STATE structure.";
-----------------------------
3)So now, I guess I have to declare a SIMCONNECT_RECV_SYSTEM_STATE structure which will receive the data I'm interested in.
"This structure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_SYSTEM_STATE.";
2)So I guess now, that I have to declare a new SIMCONNECT_RECV structure too, in order to be able to change "its" dwID parameter setting to "SIMCONNECT_RECV_ID_SYSTEM_STATE";
dwID : "The ID of the returned structure. One member of SIMCONNECT_RECV_ID.";
1)Again, I guess now, that I have to declare a SIMCONNECT_RECV_ID structure in order to "choose" this "SIMCONNECT_RECV_ID_SYSTEM_STATE" setting.
-----------------------------
So, is this code correct according to all I just said ? (code lines are indexed according to the previous steps)
--
SIMCONNECT_DATA_REQUEST_ID d(7777); //4
const char* szState='Sim'; //4
SIMCONNECT_RECV_ID a="SIMCONNECT_RECV_ID_SYSTEM_STATE"; // 1)
SIMCONNECT_RECV b(); // 2)
b.dwID = a; //2)
SIMCONNECT_RECV_SYSTEM_STATE c(); // 3)
c.dwRequestID=d; // 3)
SimConnect_RequestSystemState(AlreadyDeclaredHandle, d, szState); //4)
--
And does my c.dwRequestID need to be the same ID I'm giving to the SimConnect_RequestSystemState() funtion (=d) so they can find eachothers ?
And do not &b and &c need to be related somehow ?
According to the following prototype, if this code is correct (or when this code will be correct), is the "flying" state (1 or 0) present and accessible in the c.dwInteger variable ?
--
typedef struct SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwInteger;
float fFloat;
char szString[MAX_PATH];
};
--
Thanks in advance for your answer(s).
Regards,
bas-tiras@hotmail.fr
(sorry in advance for my english)
I'm trying to get the data according to the flying simulation state :
"If 1 is returned, the user is in control of the aircraft (he's playing), if 0 is returned, the user is navigating the UI (he's not playing)."
According to this very complete source : https://msdn.microsoft.com/en-us/library/cc526983.aspx ,
(the following indexes 4) 3) etc... were made for the indexed code at the bottom. Ignore those at the 1st reading.)
-----------------------------
4)This state can be acquired by using the SimConnect_RequestSystemState() funtion.
Prototype :
HRESULT SimConnect_RequestSystemState(
HANDLE hSimConnect,
SIMCONNECT_DATA_REQUEST_ID RequestID,
const char* szState,
);
RequestID - is the "variable" which is SIMCONNECT_DATA_REQUEST_ID typed, that I have to declare myself, and then give it to the funtion.
(I call it variable because it's not defined anywhere in the documentation)
szState - is the variable which is const char* typed, that I have to declare myself aswell (and initialize it with the value "Sim" in order to get the simulation flying state in real time), and then give it to the funtion.
"The information requested will be returned in a SIMCONNECT_RECV_SYSTEM_STATE structure.";
-----------------------------
3)So now, I guess I have to declare a SIMCONNECT_RECV_SYSTEM_STATE structure which will receive the data I'm interested in.
"This structure inherits the SIMCONNECT_RECV structure and is returned when the dwID parameter of SIMCONNECT_RECV is set to SIMCONNECT_RECV_ID_SYSTEM_STATE.";
2)So I guess now, that I have to declare a new SIMCONNECT_RECV structure too, in order to be able to change "its" dwID parameter setting to "SIMCONNECT_RECV_ID_SYSTEM_STATE";
dwID : "The ID of the returned structure. One member of SIMCONNECT_RECV_ID.";
1)Again, I guess now, that I have to declare a SIMCONNECT_RECV_ID structure in order to "choose" this "SIMCONNECT_RECV_ID_SYSTEM_STATE" setting.
-----------------------------
So, is this code correct according to all I just said ? (code lines are indexed according to the previous steps)
--
SIMCONNECT_DATA_REQUEST_ID d(7777); //4
const char* szState='Sim'; //4
SIMCONNECT_RECV_ID a="SIMCONNECT_RECV_ID_SYSTEM_STATE"; // 1)
SIMCONNECT_RECV b(); // 2)
b.dwID = a; //2)
SIMCONNECT_RECV_SYSTEM_STATE c(); // 3)
c.dwRequestID=d; // 3)
SimConnect_RequestSystemState(AlreadyDeclaredHandle, d, szState); //4)
--
And does my c.dwRequestID need to be the same ID I'm giving to the SimConnect_RequestSystemState() funtion (=d) so they can find eachothers ?
And do not &b and &c need to be related somehow ?
According to the following prototype, if this code is correct (or when this code will be correct), is the "flying" state (1 or 0) present and accessible in the c.dwInteger variable ?
--
typedef struct SIMCONNECT_RECV_SYSTEM_STATE : public SIMCONNECT_RECV {
DWORD dwRequestID;
DWORD dwInteger;
float fFloat;
char szString[MAX_PATH];
};
--
Thanks in advance for your answer(s).
Regards,
bas-tiras@hotmail.fr
Last edited:

