Ok, cool, that worked :D

One problem: I now get an error from Windows.

Here's the code:

#!/usr/bin/perl use warnings; use strict; use Win32::API; my $STANDARD_RIGHTS_REQUIRED = (0x000F0000); my $SECTION_QUERY = 0x0001; my $SECTION_MAP_WRITE = 0x0002; my $SECTION_MAP_READ = 0x0004; my $SECTION_MAP_EXECUTE = 0x0008; my $SECTION_EXTEND_SIZE = 0x0010; my $SECTION_ALL_ACCESS = ($STANDARD_RIGHTS_REQUIRED|$SECTION_Q +UERY| $SECTION_MAP_WRITE |$SECTION_MAP +_READ| $SECTION_MAP_EXECUTE |$SECTION_EXT +END_SIZE); Win32::API->Import('kernel32', 'HANDLE OpenFileMapping(DWORD dwDesired +Access, BOOL bInheritHandle, LPCTSTR lpName)'); Win32::API->Import('kernel32', 'LPVOID MapViewOfFile(HANDLE hFileMappi +ngObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFile +OffsetLow, SIZE_T dwNumberOfBytesToMap)'); my $C3_mem = "Creatures 3_mem"; my $mem_handle = OpenFileMapping($SECTION_ALL_ACCESS, 0, $C3_mem); my $mem_ptr = MapViewOfFile($mem_handle, $SECTION_ALL_ACCESS, 0, 0, 0) +;

WinXP just throws a 'This program encountered an error' blah blah blah error.


In reply to Re: Re: Re: Re: Re: Re: Win32 Shared Memory by nornagon
in thread Win32 Shared Memory by nornagon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.