buick552 Posted February 5, 2017 Report Posted February 5, 2017 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..
buick552 Posted February 5, 2017 Author Report Posted February 5, 2017 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.
Pete Dowson Posted February 5, 2017 Report Posted February 5, 2017 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
buick552 Posted February 5, 2017 Author Report Posted February 5, 2017 Ahh.. sorry sir.. correcting it right away :) And thanks a lot for the info.. Lets start working..
buick552 Posted February 5, 2017 Author Report Posted February 5, 2017 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?
buick552 Posted February 5, 2017 Author Report Posted February 5, 2017 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..
buick552 Posted February 5, 2017 Author Report Posted February 5, 2017 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 ?
Pete Dowson Posted February 5, 2017 Report Posted February 5, 2017 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
forstmeier Posted February 5, 2017 Report Posted February 5, 2017 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
buick552 Posted February 8, 2017 Author Report Posted February 8, 2017 Worked like a charm thank you very much.
Pete Dowson Posted February 8, 2017 Report Posted February 8, 2017 On 2/5/2017 at 7:50 PM, forstmeier said: Case Else Me.txtFsVersion.Text = "FS ?" Case 9 is ESP (now defunct and unsupported), Case 10 is P3D If there is ever a 64-bit P3D and a 64-bit FSUIPC (hypothetical at present) then it would be 11.
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