Jump to content
The simFlight Network Forums

View Mode Offset


Recommended Posts

Hello,

I am programing a software using VB6 to FS2004 and im trying to get from FSUIPC the view mode offset (8320) but im getting only a "0" back.

My code:

    Dim dwResult As Long
    Dim tView As Byte
    Call FSUIPC_Read(&H8320, 1, VarPtr(tView), dwResult)
    Call FSUIPC_Process(dwResult)

Can someone give me a push here?

Thanks in advance,

Omer.

Link to comment
Share on other sites

Call FSUIPC_Read(&H8320, 1, VarPtr(tView), dwResult)

Have you tried using FSUIPC's Logging to see what is going on? On the Logging tab in the Options set "IPC Read" logging and it will show what is happening. This is why Logging is provided, to help you solve such problems!

In all likelihood, from my little knowledge of VB, your "&H8320" is being compiled as hex FFFF8320, which is an invalid offset in FSUIPC. It will probably convert that to 1F8320 or similar, which is still wrong.

Why Microsoft, in their infinite wisdom, decided to sign-extend 16-bit hex values is beyond me. Folks say that even if you specify &H00008320 it is still changed by the compiler to &HFFFF8320. Utterly awful in my opinion.

I don't have any VB references here to look up, but check how to stop the sign extension. I think it is done by postpending another & character (&H8320&) but I am not sure. It's been quite a while since this silly problem last came up.

Regards

Pete

Link to comment
Share on other sites

Hey Pete,

Thanks for the quick reply. I have looked in the log and saw:

    95641  READ0 [P1236]  8320,   1 bytes: 00 

for my read. It doesn't tell me much but maybe you can learn something from it.

About what you are saying on the offset change issue by the compiler I hope another VB program could help me here.

Thanks in advance,

Omer.

Link to comment
Share on other sites

Thanks for the quick reply. I have looked in the log and saw:

    95641  READ0 [P1236]  8320,   1 bytes: 00 

for my read. It doesn't tell me much but maybe you can learn something from it.

It tells you that your read is working and that 8320 does indeed provide zero. So evidently what I said previously doen't apply to your version of VB.

So the next questions are:

1. What are you expecting to read in this Logged case, if not 00?

2. Which version of FSUIPC are you using? (Those offsets were not always supported!)

3. If you are using a version before 3.71 (and from that one Log line it looks like you are), have you purchased it and registered it as a user?

Perhaps you should try the currently supported version of FSUIPC (3.73, or 3.731 from the Announcements above) before testing again, then check the Log again please.

Regards

Pete

Link to comment
Share on other sites

Hello Pete,

When I am trying to run the code using FSUIPC version 3.73 im getting a "Incorrect version of FSUIPC, or not FSUIPC" error while trying connecting to FSUIPC. Actually thats why I tried an older version from the beginning.

Any idea why that error occur?

Thanks.

Link to comment
Share on other sites

Hello Pete,

When I am trying to run the code using FSUIPC version 3.73 im getting a "Incorrect version of FSUIPC, or not FSUIPC" error while trying connecting to FSUIPC. Actually thats why I tried an older version from the beginning.

Any idea why that error occur?

Thanks.

Show me the Log file from that attempt please. It sounds like the Signature isn't verifying correctly. Didn't you check, as advised?

And which 'older version' were you trying?

Pete

Link to comment
Share on other sites

Problem solved!

I have no idea what Ive done but the offsets return good values now, by the way when the problem was still exist I couldn't read ANY offset without it return 0. (I have tried 2 more offsets: the on ground & beacon lights)

Any way, I have another question:

Is there an offset that tells me when the simulator has finished loading the scenery or when is it loading ?

I want my program to do some acts as soon as I finish loading a flight(meaning in the plane).

Sorry for bad english.

Thanks in advance,

Omer.

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.