Jump to content
The simFlight Network Forums

Error when write the coordinates (latitude and longitude)...

Recommended Posts


I program in visual basic 6, and when sending the location coordinates the fs doesn't interpret them in the correct way.


Call FSUIPC_Write(&H560, 8, VarPtr(Text1.Text), dwResult)

Call FSUIPC_Write(&H568, 8, VarPtr(Text2.Text), dwResult)

Call FSUIPC_Process(dwResult)

Text1 and Text2 are the text boxes where I introduce the data.

And the location is in another different place.

Ups… :oops: excuses for my English it is not the best.

On the other hand if you can help me then do I need to know the code OACI of the aerodrome that I am or the but near, does it exist some variable or form?

Link to comment
Share on other sites

you have to do some conversions

here is my routine to set the plane at the proper lat/long/alt

Public Function set_plane(lat As Single, lon As Single, alt As Single, hdg As Single) As Boolean

Dim x As Long

Dim dwresult As Long

x = FTOM(CLng(alt))

Call FSUIPC_Write(&H574, 4, VarPtr(x), dwresult)

x = lat * 10001750 / 90

Call FSUIPC_Write(&H564, 4, VarPtr(x), dwresult)

x = lon * 65536 * 65536 / 360

Call FSUIPC_Write(&H56C, 4, VarPtr(x), dwresult)

x = hdg * 65536 * 65536 / 360

Call FSUIPC_Write(&H580, 4, VarPtr(x), dwresult)

Call FSUIPC_Process(dwresult)

Link to comment
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
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.