Jump to content
The simFlight Network Forums

02BC in Pete Dawson's offsets list but H2BC in client guide


buick552

Recommended Posts

Gentlemen, I am novice about this topic, I am writing an application in VB, today I managed to connect my app to communicate with FSX using the clientexample vb project's codes. What I don't understand is, for example, IAS offset in Pete Dowson's offsets list pdf is 02BC and the size is 4. But I see that you used &H2BC in the client example project.

So, my question is, should I convert something to something? 0 (zero) turns to H ? Or what is the formula? Just give me a little clue, and I will get through it. I need to use a lot of offsets so please can you show me a way about how to use Pete Dowson's offset values with this client?

Thank you..

Link to comment
Share on other sites

I just tried 

Dim GS As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H2B4)

then used this

Dim GSkts As Double = (GS.Value * 1.9438445) / 65536.0

to get the ground speed value and it worked. But I am still confused, H2B4 is described as 02B4 in Pete Dowson's FSUIPC4 Offsets Status pdf manual.

 

Link to comment
Share on other sites

7 minutes ago, buick552 said:

H2B4 is described as 02B4 in Pete Dawson's FSUIPC4 Offsets Status pdf manual.

In VB the prefix &H means the number is in hexadecimal. In C/C++ the prefix 0X is used instead. All offsets listed in the FSUIPC documentation are in hexadecimal.

Really, for basic questions about VB you should use a beginners guide to programming in VB.

Oh, and the name is "Dowson" by the way, with an 'o' not an 'a'.

Pete

 

Link to comment
Share on other sites

Ok one final question then.. In order to limit the users, I mean, I want my program to make an initial check, 

 

* If the FSUIPC version is older than 3.769

* If the FS is not FS2004, FSX or P3D, I dont want it to start. Where should I look for the FSUIPC version and siminfo sir?

Link to comment
Share on other sites

Ok, I found the FSUIPC version by..

Dim fsuipcver As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3304)

the result is 1224736768 which is hexadecimal,

I use the HEX function of Visual Basic and I get 4900000, divide it by 10000000

and the result is 4.900 which is my FSUIPC version.. now lets do something about the FS version..

Link to comment
Share on other sites

Gentlemen, I need to ask this because I have FSX only on my computer, I dont have the chance to try with P3D or FS2004..

Now,  I used this code..

Dim fsver As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3308)

And I received -86114296 in turn. I again used the hex function and the result was FADE0008.

Mr Dowson, in your pdf guide, you declare that "FS version, as determined by FSUIPC: Currently only one of these:
1 = FS98
2 = FS2000
3 = CFS2
4 = CFS1
5 = reserved
6 = FS2002
7 = FS2004 ―A Century of Flight‖
8 = FSX
9 = ESP"

Now that I found FADE0008, if I trim the first part which is FADE000, then the result would be 8, and I use FSX. 

If I had had FS2004, the result would have been FADE0007 ?

Link to comment
Share on other sites

1 hour ago, buick552 said:

Mr Dowson, in your pdf guide, you declare that "FS version, as determined by FSUIPC: Currently only one of these:

You are using an out of date reference. The current document for offsets is in your FSUIPC Documents folder, inside the FSX Modules folder, along with the other FSUIPC Documentation.

Offset 3308 is a 2-byte value, not 4-bye as you are reading. The "FADE" part is another documented value, if you go look.

2 byte values are probably not called "Integers" in VB. You need to learn VB before you write a VB program!

Pete

 

Link to comment
Share on other sites

2 hours ago, buick552 said:

Gentlemen, I need to ask this because I have FSX only on my computer, I dont have the chance to try with P3D or FS2004..

Now,  I used this code..

Dim fsver As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3308)

And I received -86114296 in turn. I again used the hex function and the result was FADE0008.

Mr Dowson, in your pdf guide, you declare that "FS version, as determined by FSUIPC: Currently only one of these:
1 = FS98
2 = FS2000
3 = CFS2
4 = CFS1
5 = reserved
6 = FS2002
7 = FS2004 ―A Century of Flight‖
8 = FSX
9 = ESP"

Now that I found FADE0008, if I trim the first part which is FADE000, then the result would be 8, and I use FSX. 

If I had had FS2004, the result would have been FADE0007 ?

Try this one:

Dim FsVersion As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H3308)

                Dim iShort As Short = FsVersion.Value
                Select Case iShort
                    Case 1
                        Me.txtFsVersion.Text = "FS98"
                    Case 2
                        Me.txtFsVersion.Text = "FS2000"
                    Case 3
                        Me.txtFsVersion.Text = "CFS2"
                    Case 4
                        Me.txtFsVersion.Text = "CFS1"
                    Case 5
                        Me.txtFsVersion.Text = "Fly!"
                    Case 6
                        Me.txtFsVersion.Text = "FS2002"
                    Case 7
                        Me.txtFsVersion.Text = "FS2004"
                    Case 8
                        Me.txtFsVersion.Text = "FSX"
                    Case Else
                        Me.txtFsVersion.Text = "FS ?"
                End Select

 

Link to comment
Share on other sites

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.