Jump to content
The simFlight Network Forums

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


Recommended Posts

Pete

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

Example:

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.