cellular55 Posted March 2, 2013 Report Posted March 2, 2013 Hi, I'm writing an app that using the G5.csv file create by makerunways would move the aicraft in a specific position of the airports. Due to some limits of VB I'm not able to do that with a single write of the offsets 560 and 568 and I'm facing some issues. If it seems that I correctly write the value of the high part (ie the offset 564 long 4) checking the value before and after the writing (the formula lat_degrees/90*10001750), I'm not able to find the right formula to write the offset 560 long 4. The same issue is to change the longitude (good value written at offset 572 long 4), but nothing to do with the low part at 568. Hope in same help Thanks and best regards Joe
Pete Dowson Posted March 2, 2013 Report Posted March 2, 2013 Due to some limits of VB I'm not able to do that with a single write of the offsets 560 and 568 and I'm facing some issues. I don't believe that VB prevents you making an array sufficient to hold two values like that! If VB cannot support arrays it isn't a proper programming language! If it seems that I correctly write the value of the high part (ie the offset 564 long 4) checking the value before and after the writing (the formula lat_degrees/90*10001750), I'm not able to find the right formula to write the offset 560 long 4. Use a 64-bit variable instead. It is much much easier. How it is addressed in your version of VB I don't know, but see http://www.aivosto.com/vbtips/datatypes.html Regards Pete
cellular55 Posted March 2, 2013 Author Report Posted March 2, 2013 Hi, I have used all the variable types in VB, but I get aleays an overflow error tring to write at the same time the 64 bits It is possible to define arrays in VB, but honestly I do not understand how this could solve the issue transforming from lat and lon in degrees to kt and lon in FSX format Best regards Joe
Paul Henty Posted March 2, 2013 Report Posted March 2, 2013 Longitude and Latitude need to be written as 64 bit integers. While VB6 doesn't actually have them, there is a 'currency' type which stores decimal numbers as 64 bit integers scaled by 10000. You can use this to fake a 64 bit integer. Below is some code that writes the latitude. You can do the same for longitude and reverse the process for reading. Dim latitude As DoubleDim FakeLat As Currencylatitude = 51.45latitude = latitude * 90# / (10001750# * 65536# * 65536#)FakeLat = latitude / 10000#FSUIPC_Write(&H560, 8, VarPtr(FakeLat), dwResult)FSUIPC_Process(dwResult)[/CODE]Paul
cellular55 Posted March 3, 2013 Author Report Posted March 3, 2013 Hi, thanks a lot.. you are my hero !!!! :razz: That worked great !!!!! :razz: :razz: Joe
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