Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi!

I am fighting with problems in a VB-Porgram.

At first i use the return code of FSUIPC_Open and the dwresult to start the communication with FS2004.

This works and the communication starts quite early (at the point the blue window to choose a flight appears).

Now the program reads timer-controlled many values from the FS using FSUIPC_Read.

The result for the first FSUIPC_Read is used to test for a succssful read.

Nevertheless my program locks up whenever the FS becomes "unavailable".

Is there a safe way to test for successful contact with FS ?

Posted

Nevertheless my program locks up whenever the FS becomes "unavailable".

It shouldn't "lock up" -- the SendMessageTimeout used in the code you call has a timeout 9that is why it is used). There may be several retries too, but it would probably do, say, 10 retries with a timeout of 2 seconds, so in the worst case take 20 seconds.

I don't know the VB stuff, but this would be typical -- take a look. All the source is supplied, so there's really nothing hidden here, no mystery.

Is there a safe way to test for successful contact with FS ?

If FS crashes or hangs the problem is usually thatnothing happens. Hence the time-out on the only part of your code which communicates with the FS process -- the SendMessageTimeout. How your program is hanging I don't know, but you should be able to find out by debugging.

Regards,

Pete

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.