Sign in to follow this  
GHD

Set Data example

Recommended Posts

I am attempting to modify the Set Data example to use SIMCONNECT_DATA_LATLONALT instead of SIMCONNECT_DATA_INITPOSITION.The program compiles and runs but the user aircraft doesn't move. case EVENT_6: {/* SIMCONNECT_DATA_INITPOSITION Init; Init.Altitude = 5000.0; Init.Latitude = 54.9315248414087; Init.Longitude = -2.95371576251096; Init.Pitch = 0.0; Init.Bank = -1.0; Init.Heading = 180.0; Init.OnGround = 0; Init.Airspeed = 60; hr = SimConnect_SetDataOnSimObject(hSimConnect, DEFINITION_6, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(Init), &Init );*/ SIMCONNECT_DATA_LATLONALT pos; pos.Latitude = 54.9315248414087; pos.Longitude = -2.9537157625109; pos.Altitude = 5000.0; hr = SimConnect_SetDataOnSimObject(hSimConnect, DEFINITION_7, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(pos), &pos ); printf("nEVENT_6 received and data sent");I have added DEFINITION_7 to the DATA_DEFINE_ID and added: hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_7, "Position",NULL,SIMCONNECT_DATATYPE_LATLONALT);to set up the definition.I would be grateful for your comments.George

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

It's ok, I've figured it out. I can't use a SIMCONNECT_DATA_LATLONALT struct, I need to use a custom struct.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this