Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I´m using this script to check if the connection to FSUIPC is alive, but I may be it´s not the best one, please if someone can make it better, I will appreciate very much, because I getting timeout very offten with this script, and onestly I think that is this particulary offset or many this login. any way here is the code:

// fsuipc_error_msg()  is a function that I create to display the error msg.//
//I choose that offset randomly so may be that could be a problem too.//

    If FSUIPC_Read(&H264, 2, VarPtr(f), dwResult) Then

        If FSUIPC_Process(dwResult) Then

        Else
            fsuipc_error_msg(Str(dwResult) & "_1")
        End If
    Else
        fsuipc_error_msg(Str(dwResult) & "_2")
    End If

I hope that some one can help.

Regards

Thomas

Posted

Hi,

I'm using this function in my FSCONV program. I call it every other minute, works fine!

The rationale is that if you're not able to get the Time from FSUIPC, it is no longer running.

BOOL stillAlive()

{

char chTime[3];

return (! ((!FSUIPC_Read(0x238, 3, chTime, &DwResult) || !

FSUIPC_Process(&DwResult))));

}

Posted

Hi,

Have done some logic symplification. This should do the same:

BOOL stillAlive()

{

char chTime[3];

return ( FSUIPC_Read(0x238, 3, chTime, &DwResult) && FSUIPC_Process(&DwResult));

}

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.