Indagroove Posted February 25, 2004 Report Posted February 25, 2004 Hey all you VB gurus out there.... How do I read the 0609 offset. I have tried Byte, Long, Integer, Double, and nothing works. I keep getting 0 or empty. It is the Engine Type, Byte, DEC, and should return a number. 0 = Piston 1 = Jet 5 = Turboprop But I just cant get it to work. Please help Thanks.
rickalty Posted February 25, 2004 Report Posted February 25, 2004 I just added it to one of my panels just to try, and it worked fine for me when DIM'd as an Integer. Here's the code... Dim Engine As Integer Call FSUIPC_Read(&H609, 2, VarPtr(Engine), dwResult) Call FSUIPC_Process(dwResult) lblEngine = Engine That worked. Richard
Indagroove Posted February 25, 2004 Author Report Posted February 25, 2004 OK that worked for me, it was the 2 that did it. Thanks Now how do I know what length to use in these things. That seems to get me into trouble all the time. As In Call FSUIPC_Read(&H609, #, VarPtr(Engine), dwResult) How can I find out what number to put in the # spot? For the different offsets? is there a basic outline somewhere?
rickalty Posted February 25, 2004 Report Posted February 25, 2004 Yes, it's right there in the table of offsets in the SDK. First column is the offset, second is the size. Richard
Pete Dowson Posted March 12, 2004 Report Posted March 12, 2004 Sorry for the delay in replying -- I've been on holiday with no Internet access. I'm just trying to catch up with an enormous backlog now! OK that worked for me, it was the 2 that did it. It will only work if, by sheer liuck, the byte after this is zero. No one will guarantee that, and it may depend on many other things. The correct length for a 1 byte value is 1. Declare it as a byte or character or whatever the language calls something which is 8 bits long. Now how do I know what length to use in these things. That seems to get me into trouble all the time. The length in bytes is provided in the table in the Programmer's Guide. It is in the second column, called "size". That it the number of bytes. That is exacly what it is for, so you know how big the value is! How can I find out what number to put in the # spot? For the different offsets? is there a basic outline somewhere? Refer to the table I provide! That is EXACTLY it!! You can read that 1 byte into an Integer, but since 1 byte is shorter than an Integer (the latter is usually 32 bits -- or 4 bytes), there may be rubbish in the other bytes still. All you need to do is set the Integer to zero (0), then read the one byte into it. Pete
Craig Phillips Posted March 12, 2004 Report Posted March 12, 2004 How do you write to FSUIPC using Visual Basic. I have been trying to set the pause control but it doesnt seem to work. Please help. Thanx
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