Tom Easterbrook Posted December 31, 2014 Report Posted December 31, 2014 hi all, I'm currently getting an error when trying to register an offset the code I'm using is in the screenshot below Happy New Year Tom
Paul Henty Posted January 2, 2015 Report Posted January 2, 2015 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
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