• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Problem with reading FSUIPC OFFSET 0x07D4!

Messages
3
Country
china
Got Problem to read the Autopilot altitude !

my envioroment:VS2008 FSX FSUIPCV4.2

the Autopilot altitude value explained in the manual:FSUIPC4 Offsets Status.pdf

07D4 4 Autopilot altitude value, as metres*65536 Ok Ok

in my project
I declare a struct:
struct AUTOPILOT
{
int Status[6];
UINT uHDG;//heading
TCHAR szHDG[256];
DWORD dwALT;//altitude
TCHAR szALT[256];
UINT uAS;//air speed
TCHAR szAS[256];
long lVS;//vertical speed
TCHAR szVS[256];
}AP;

and I use the following function to get the value of AP' altitude:

if (!FSUIPC_Read(0x07D4,2, &AP.dwALT, &dwResult) ||
// If we wanted other reads/writes at the same time, we could put them here
!FSUIPC_Process(&dwResult)) // Process the request(s)
{
SetDlgItemText(hwnd,IDC_EDIT_AP_ALT,TEXT("FAIL"));
}
else
{
wsprintf(AP.szALT,TEXT("%05d"),AP.dwALT/65536);
SetDlgItemText(hwnd,IDC_EDIT_AP_ALT,AP.szALT);
}

but the AP.szALT always get the "00000"

I make a break point on the "else" line,and check the value of the AP.dwALT in the debug mode,which I read in the offset 0x07D4.
It's so weird,when the AP altitude valued in the FSX is 100,I got 31457(decimal system) from the AP.dwALT,more showed below:
FSX AP.szALT (decimal system)
0 00000
100 31457
200 32915
300 28836

1000 52428

99900 34048

I dont know what is going wrong with my code and very confuse about this.
Very appreciate if somebody Colud help me!aband

Posts: 1
Joined: Tue Jun 01, 2010 8:23 am
E-mail aband
 
Last edited:
Back
Top