Jump to content

Found a problem in the VB.NET SDK sample


Guest
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

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