Jump to content
The simFlight Network Forums

Recommended Posts

Posted

i copied the code form the example in the SDK for C# but im getting a value of 0 when pulling the longitude from FS?

the code:

double longHi = 0;
            double longLo = 0;
            double longitude = 0;
            // Get longitude
            result = fsuipc.FSUIPC_Read(0x056C, 4, ref token, ref dwResult);
            result = fsuipc.FSUIPC_Process(ref dwResult);
            result = fsuipc.FSUIPC_Get(ref token, ref dwResult);
            longHi = dwResult;

            result = fsuipc.FSUIPC_Read(0x0568, 4, ref token, ref dwResult);
            result = fsuipc.FSUIPC_Process(ref dwResult);
            result = fsuipc.FSUIPC_Get(ref token, ref dwResult);
            longLo = dwResult;

            if (longLo != 0)
            {
                longLo = longLo / (65536.0 * 65536.0);
            }
            if (longHi > 0)
            {
                longitude = longHi + longLo;
                input3.Text = Convert.ToString(Convert.ToInt32(longitude));
            }
            else
            {
                longitude = longHi - longLo;
                input3.Text = Convert.ToString(Convert.ToInt32(longitude));
            }

Please sign in to comment

You will be able to leave a comment after signing in



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.