Hello all. Desperate newbie with a question here ...
I was hoping that somebody could reveal how to set up a SimConnect data definition for reading a variable whose units are listed as "Flags".
To be specific: I'm trying to get the bits in the variable "NAV CODES:1" into a C/C++ structure field, and I don't know what to use for either the SimConnect datatype or the corresponding C/C++ type.
My first attempt was to use an "unsigned int" in my C/C++ structure and use the following call to SimConnect_AddToDataDefinition:
SimConnect_AddToDataDefinition(hSimConnect, DATA_DEFINITION_ID_AIRCRAFT_STATE, "NAV CODES:1", "Flags", SIMCONNECT_DATATYPE_INT32)
That doesn't generate a SimConnect exception, but it does corrupt the C/C++ struct with garbage.
Any help appreciated! Thanks!
Aside: I rather wish the FS SDK variable table just included columns for the appropriate SimConnect datatypes and corresponding C/C++ data types! Anybody know why this rather useful information isn't in the documentation? Perhaps I'm just missing something?
I was hoping that somebody could reveal how to set up a SimConnect data definition for reading a variable whose units are listed as "Flags".
To be specific: I'm trying to get the bits in the variable "NAV CODES:1" into a C/C++ structure field, and I don't know what to use for either the SimConnect datatype or the corresponding C/C++ type.
My first attempt was to use an "unsigned int" in my C/C++ structure and use the following call to SimConnect_AddToDataDefinition:
SimConnect_AddToDataDefinition(hSimConnect, DATA_DEFINITION_ID_AIRCRAFT_STATE, "NAV CODES:1", "Flags", SIMCONNECT_DATATYPE_INT32)
That doesn't generate a SimConnect exception, but it does corrupt the C/C++ struct with garbage.
Any help appreciated! Thanks!
Aside: I rather wish the FS SDK variable table just included columns for the appropriate SimConnect datatypes and corresponding C/C++ data types! Anybody know why this rather useful information isn't in the documentation? Perhaps I'm just missing something?
