www.digitalmars.com         C & C++   DMDScript  

c++ - pointers to global memory

reply Owerlord <Owerlord_member pathlink.com> writes:
How can I get adress of an varible (table, structure) that indicates not only
the position in local space of a program (in win32) but position in memory, so
an other aplication could enter it.
By the definitions od Ansi C the "far*" would be it, but when I run a program
twice (I run the second program without closeing the first) , I get the same
adress, so it can not be an global adress.

Lucas
sorry for my engish - it's not my native
Dec 13 2002
parent Kon Tantos <ksoft1 attglobal.net> writes:
Each process gets it's own unique address space which cannot be shared
with other processes. You need to make some Win32 API calls to create a
'shared memory' area for different processes. Try looking up
CreateFileMapping(), MapViewOfFile() & OpenFilemapping().

Owerlord wrote:
 
 How can I get adress of an varible (table, structure) that indicates not only
 the position in local space of a program (in win32) but position in memory, so
 an other aplication could enter it.
 By the definitions od Ansi C the "far*" would be it, but when I run a program
 twice (I run the second program without closeing the first) , I get the same
 adress, so it can not be an global adress.
 
 Lucas
 sorry for my engish - it's not my native

-- Regards Kon Tantos ksoft1 attglobal.net or kon.tantos tafe.nsw.edu.au
Dec 13 2002