Jump to content
The simFlight Network Forums

Correct way to end a custom program ...


Recommended Posts

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.