Jump to content
The simFlight Network Forums

Recommended Posts

Posted

This code (in the FSUIPC_Open function) returns a System.NullReferenceException (as szTemp is never loaded):

' create the name of our file-mapping object

nTry = nTry + 1 ' Ensures a unique string is used in case user closes and reopens

szName = FS6IPC_MSGNAME1 & ":" & Hex(GetCurrentProcessId()) & ":" & Hex(nTry) & Chr(0)

If (szName.Length > 23) Then '24 chars max

szName = szTemp.Substring(0, 23) & Chr(0)

End If

I've modified to:

' create the name of our file-mapping object

nTry = nTry + 1 ' Ensures a unique string is used in case user closes and reopens

szName = FS6IPC_MSGNAME1 & ":" & Hex(GetCurrentProcessId()) & ":" & Hex(nTry) & Chr(0)

If (szName.Length > 23) Then '24 chars max

szName = szName.Substring(0, 23) & Chr(0)

End If

and removed the Dim for szTemp. That solved the problem.

Jim

Posted
This code (in the FSUIPC_Open function) returns a System.NullReferenceException (as szTemp is never loaded):

Thanks. I'll forward your message to the author. I had assumed he'd tested it, so this is a bit odd. I know nothing about VB or .Net so I don't just want to change it myself.

Pete

Please sign in to comment

You will be able to leave a comment after signing in



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.