Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I am running a program which used to work but now gives all ground altitudes as zero. The code is:

double dLat, dLong;

double dLat1, dLong1, dHeight;

long long Lat;

long long Lat1;

long long Long;

long long Long1;

long GroundAlt;

FSConnection.Read(0x560, 8, &Lat1);

FSConnection.Read(0x568, 8, &Long1);

if (FSConnection.ReadAndProcess(0x20, 4, &GroundAlt))

{

dLat1 = Lat1;

dLat1 = dLat1*90.0/(10001750.0 * 65536.0 * 65536.0);

dLong1 = Long1;

dLong1 = dLong1*360.0/(65536.0*65536.0*65536.0*65536.0);

dHeight = GroundAlt;

dHeight = dHeight/256.0;

}

The latitide and longitude are correct but the altitude is always returned as zero.

Any ideas?

George

Edit. I've just tried with V4.203 with exactly the same result.

Posted
I am running a program which used to work but now gives all ground altitudes as zero. The code is:

The latitide and longitude are correct but the altitude is always returned as zero.

...

Edit. I've just tried with V4.203 with exactly the same result.

Could you first try using Logging and/or FSInterrogate (the tools provided to investigate such things), to check what you are reading to what is provided?

BTW I've just re-checked, and both ground altitude and aircraft altitude read-outs are still fine. (There's actually no reason why they shouldn't be as it is all down to Simconnect these days! ;-)).

Regards

Pete

Posted

Thanks for the reply Pete. FSInterrogate confirms the program findings, offset 0x20 is being returned as zero.

However, the program positions the aircraft before interrogating the height. I was running FSX in paused, slew mode and I could see that the position was being changed but the altitude remained the same. I then "unpaused" FSX and it worked correctly.

I am sure I have run it previously with FSX paused but perhaps I hadn't :?

Sorry to have troubled you.

George

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.