   shared memory not really shared?
  hey all,i'm experiencing some confusion regarding shared memory.  I have 2 applications running, one of which allocated memory using GlobalAlloc(GMEM_FIXED,size) and passed the memory pointer to the other program.  I've verified that the 2 programs both have a pointer to the same memory location (the number is the same).  however, if i change the memory contents with one, the other doesn't see it.  they read back only the values they're setting, not the value the OTHER program is setting it to.  Am i misunderstanding how shared memory works?what i'm trying to do is create an externally controlled log-managing program.  I'd like my main program to send its log output to a chunk of memory controlled by my logging program (running at the same time), so if my main program crashes, my log program can still save out the data.  the reason i'm not just dumping the log to a file is that the file gets too large (and writing to disk is slow) - i only want to save the last part of the log if my main program crashes.any ideas?thanks,alan   
  GlobalAlloc does not allocate shared memory it allocates heap memory. If you want to share memory between processes use a named file mapping. See CreateFileMapping, MapViewOfFile and Creating Named Shared Memory.   ;  Just because the numbers are the same does not mean that they point to the same place in memory.  Each process has its own addressing space.  Think of pointers as offsets from the beginning of that application's space in memory, and you see why your changes don't propogate between programs.  In fact, writing to that pointer in the other process could have catastrophic results.~BenDilts( void );   