Jump to content
The simFlight Network Forums

Little Correction On VB Source

Recommended Posts

Hi Mr.Dowson,

I found a little bug on the FSUIPC.BAS file. I fix the problem. And I would like to inform you about this fix.

Problem :

When The first attemp to connect to FSUPIC the FSUIPC_OPEN function is used. Everything goes well. You can have version of actual FSUIPC.dll.

But when you try to CHECK the connection by using FSUIPC_OPEN, because of the earlier established connection, the function returns with errorcode 1 (Attempt to Open when already Open) and exits form function. Before exiting from function, the vesion information is reseted.


Change the place of initialize varibles in FSUIPC_OPEN function :

' abort if already started

If (m_pView& <> 0) Then


FSUIPC_Open = False

Exit Function

End If

' initialize vars

nTry = 0

fWideFS = False

i = 0

FSUIPC_Version = 0

FSUIPC_FS_Version = 0


Link to comment
Share on other sites

I found a little bug on the FSUIPC.BAS file. I fix the problem. And I would like to inform you about this fix.

Thanks. It looks like the VB programmer, who converted this from my own C source file (IPCuser.c, also in the SDK) made an error. I wonder if this carried over into any of the other language versions?

In the C version the sequence is actually:

static int nTry = 0;


int i = 0;

// abort if already started

if (m_pView)

{ *pdwResult = FSUIPC_ERR_OPEN;

return FALSE;


// Clear version information, so know when connected

FSUIPC_Version = FSUIPC_FS_Version = 0;

As you can see, it is only the two Version Number fields that need clearing after the "already open" check. In C the other variables are local to the procedure in any case, and not accessible outside.

I'll fix the VB source (carefully, as I am not familiar with VB :wink: ) for the next update.



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.