in reply to Re: Re: Re: Re: Win32 Shared Memory
in thread Win32 Shared Memory
The problem is your passing a string constant for the last parameter of OpenFileMapping(). Seems like it would be a safe bet I know, given that the prototype is defined as LPCTSTR.
The problem is that the C code underlying the API is expecting strings to be null terminated and Perls strings aren't by default. To correct this, Win32::API has to add a null before passing them along. Rather than copying the string you pass into a temporary variable and then appending the null, it simply tacks a null on the end of the string you pass--but if it is a constant, it's read-only and you get the error.
The upshot is, if you assign your constant to a variable, and then pass the variable, then null can be added successfully and the error goes away.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: Win32 Shared Memory
by nornagon (Acolyte) on May 16, 2004 at 00:17 UTC | |
by BrowserUk (Patriarch) on May 16, 2004 at 00:29 UTC | |
by nornagon (Acolyte) on May 16, 2004 at 03:29 UTC | |
by BrowserUk (Patriarch) on May 16, 2004 at 04:54 UTC | |
by nornagon (Acolyte) on May 16, 2004 at 05:26 UTC | |
| |
|
Re: Re: Re: Re: Re: Re: Win32 Shared Memory
by ysth (Canon) on May 16, 2004 at 05:07 UTC | |
by BrowserUk (Patriarch) on May 16, 2004 at 05:31 UTC | |
by ysth (Canon) on May 16, 2004 at 06:24 UTC | |
by BrowserUk (Patriarch) on May 16, 2004 at 07:28 UTC |