• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

String Variable Values from RequestDataOnSimObject

Messages
9
Country
unitedstates
[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
 
Last edited:
Tim,

Thank you very much! Duh! :o

Turns out I was trusting the translation of the C headers to Pascal I got off the Web too much - upon closer examination, it defines a wrong signature for the SimConnect_AddToDataDefinition().

Now onto exploring SimConnect some more...

Thanks again,
AW
 
Back
Top