Some strings are declared as "variable length", see screenshot below. But when I add them as SIMCONNECT_DATATYPE_STRINGV, I do not get a callback ever when I request data on that particular definition. Providing a fixed length (in the struct and in the AddToDataDefinition) works.
Does not work:
SimConnect_AddToDataDefinition(hSimConnect, DataDefinitionAircraftStringData, "GPS APPROACH AIRPORT ID", NULL, SIMCONNECT_DATATYPE_STRINGV))
Does work:
SimConnect_AddToDataDefinition(hSimConnect, DataDefinitionAircraftStringData, "GPS APPROACH AIRPORT ID", NULL, SIMCONNECT_DATATYPE_STRING32))
This raises three questions:
Does not work:
SimConnect_AddToDataDefinition(hSimConnect, DataDefinitionAircraftStringData, "GPS APPROACH AIRPORT ID", NULL, SIMCONNECT_DATATYPE_STRINGV))
Does work:
SimConnect_AddToDataDefinition(hSimConnect, DataDefinitionAircraftStringData, "GPS APPROACH AIRPORT ID", NULL, SIMCONNECT_DATATYPE_STRING32))
This raises three questions:
- When is SIMCONNECT_DATATYPE_STRINGV actually used?
- As how long do I set such a variable string, to 256, to 260, how do I know? Title is always set to 256 in the examples, do I set GPS APPROACH AIRPORT ID to 256 as well?
- Some values have a length different from the predefined enum values, e.g. ATC_ID is specified as length 10, so I would use SIMCONNECT_DATATYPE_STRING32 (closest match) and give away the 22 bytes?
Attachments
Last edited:
