Jump to content
The simFlight Network Forums

VB.Net Declared Value

Recommended Posts

What would happen if I decalred this fsx only variable if the user was NOT running FSX? Would the app throw an error or would it simply ignore it?

Dim fuelfsx As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H126C)

All offsets, 0000 to FFFF, are valid offsets in all versions of FS/CFS/ESP since and including FS98. The offset is either a memory reference to an area in FSUIPC itself, or it is mapped into a place somewhere in FS's other modules or assigned memory.

Reading any offset cannot do any harm, though you may just get rubbish.

Writing to an undefined offset may just get an error logged by FSUIPC, if it is listed as a definite no-no, but it could conceivably crash FS or get other unexpected results -- not in FSX or ESP, because ALL the memory is owned by FSUIPC in those cases -- but certainly in FS9 and before, since some of the mappings are to areas of unknown use in FS.

So, for reading only you shouldn't need to worry. For writing you should realy first check the FS version number, which is avaiolable for you as an numeric code in offset 3308.



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.