Alejandro Lobo-Guerrero C Posted November 3, 2006 Report Posted November 3, 2006 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?
jd Posted November 3, 2006 Report Posted November 3, 2006 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)
Alejandro Lobo-Guerrero C Posted November 3, 2006 Author Report Posted November 3, 2006 Thank you for the help, I have used that function and I realized the errors that I made a thousand thank you jd for the help in neither time. :wink:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now