Jump to content
The simFlight Network Forums

cannot register offset


Recommended Posts

Hi Tom,

 

Your post appeared eventually - I think it's because new users need their first posts need to be reviewed by a moderator.

 

Even though we dealt with this on PM I'm including my reply here in case anyone else comes across this post who has a similar problem.

 

 

When using Hexadecimal notation in VB you need to add &H at the start of the number so the compiler knows that you want to use Hex. So in the brackets you need:

 

(&H23A)

 

Note that you can type (&H023A) but the code editor will probably remove the leading 0 to give the above.

 

FSUIPC offsets are always given in Hex, so even if the offset address contains only numbers you still need to prefix with &H. If you don't, it will compile okay but you'll be getting a completely different offset.

 

I notice from your code that you've declared (Dim'ed) the offset inside the Form load event. You should always declare the offsets at the class (form) level. This means they will be accessible from anywhere in the form and will prevent the offsets being created more than once.

 

So your code should look more like this:

Imports FSUIPC

Public Class Form1

    Dim secondfstime as Offset(Of Byte) = New FSUIPC.Offset(Of Byte)(&H23A)
    ' Other offsets go here

    Public Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        FSUIPCConnection.Open()
    End Sub

End Class

Paul

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.