- Messages
- 9
- Country

[FSX] String Variable Values from RequestDataOnSimObject
Greetings Everyone,
This is my first post here and to say that I am a bit of a newb with SimConnect would be an understatement, so please, bear with me.
I am having difficulty subscribing for string-typed data. Variables returning numeric values I have no problem with, but for whatever reason I can't get anything that's a string.
For example,
SimConnect_AddToDataDefinition(hSimConnect, Ord(DefinitionPdr),
'Vertical Speed', 'Feet per second', SIMCONNECT_DATATYPE_FLOAT32,
0, DATA_VERTICAL_SPEED);
works just fine when I subscribe via SimConnect_RequestDataOnSimObject(). I get events in my dispatch-handler as expected.
But this:
SimConnect_AddToDataDefinition(hSimConnect, Ord(DefinitionPdr),
'TITLE', 'string', SIMCONNECT_DATAType_STRING256,
0, DATA_TITLE);
for whatever reason does not work, meaning I am not receiving DATA_TITLE items; ever. The same applies for just about any other string variable I tried. I am particularly interested in "GPS WP_NEXT ID", for example, but no luck.
BTW, this is Delphi code, if you wondered, but I will gladly accept examples in any un-managed language of your choice, so C or C++ is fine.
I know I am doing something wrong, but what is it? Why am I not getting these string values back?
AW
Greetings Everyone,
This is my first post here and to say that I am a bit of a newb with SimConnect would be an understatement, so please, bear with me.
I am having difficulty subscribing for string-typed data. Variables returning numeric values I have no problem with, but for whatever reason I can't get anything that's a string.
For example,
SimConnect_AddToDataDefinition(hSimConnect, Ord(DefinitionPdr),
'Vertical Speed', 'Feet per second', SIMCONNECT_DATATYPE_FLOAT32,
0, DATA_VERTICAL_SPEED);
works just fine when I subscribe via SimConnect_RequestDataOnSimObject(). I get events in my dispatch-handler as expected.
But this:
SimConnect_AddToDataDefinition(hSimConnect, Ord(DefinitionPdr),
'TITLE', 'string', SIMCONNECT_DATAType_STRING256,
0, DATA_TITLE);
for whatever reason does not work, meaning I am not receiving DATA_TITLE items; ever. The same applies for just about any other string variable I tried. I am particularly interested in "GPS WP_NEXT ID", for example, but no luck.
BTW, this is Delphi code, if you wondered, but I will gladly accept examples in any un-managed language of your choice, so C or C++ is fine.
I know I am doing something wrong, but what is it? Why am I not getting these string values back?
AW
Last edited:
