IanM I guess this is for u :p
ok I can't for the life of me get this to share..
if you compile and run the code below it will error
However....
Global NAME AS DWORD = 0
Global OBJ_NAME AS DWORD = 0
NAME = FIND FREE BANK()
OBJ_NAME = FIND FREE SYSOBJ()
MAKE SYSOBJ MUTEX OBJ_NAME,"OBJ_NAME"
MAP SHARED MEM TO BANK "NAME",NAME,1024
WRITE BANK STRING NAME,0,"John Q Smith",1024
do
if IS SYSOBJ LOCKED (OBJ_NAME) = 0 and SYSOBJ EXIST(OBJ_NAME) = 1 then LOCK SYSOBJ (OBJ_NAME)
CLS
text 0,30,"FPS: "+str$(screen fps())
text 0,42,"Memory ID: "+STR$(NAME)+" Share Name: "+GET BANK SHARED NAME$(NAME)+" Contents: "+BANK STRING$(NAME,0,1024)
text 0,59,"Object ID: "+STR$(OBJ_NAME)+" Object Exist: "+STR$(SYSOBJ EXIST(OBJ_NAME))+" Share Name: "+GET SYSOBJ NAME$(OBJ_NAME)
sync
loop
if you make the code look like this it will work
Global NAME AS DWORD = 0
Global OBJ_NAME AS DWORD = 0
NAME = FIND FREE BANK()
OBJ_NAME = FIND FREE SYSOBJ()
MAKE SYSOBJ MUTEX OBJ_NAME,"OBJ_NAME"
MAP SHARED MEM TO BANK "NAME",NAME,1024
WRITE BANK STRING NAME,0,"John Q Smith",1024
do
if IS SYSOBJ LOCKED (OBJ_NAME) = 0 and SYSOBJ EXIST(OBJ_NAME) = 1 then LOCK SYSOBJ (OBJ_NAME)
CLS
text 0,30,"FPS: "+str$(screen fps())
text 0,42,"Memory ID: "+STR$(NAME)+" Share Name: "+GET BANK SHARED NAME$(NAME)+" Contents: "+BANK STRING$(NAME,0,1024)
text 0,59,"Object ID: "+STR$(OBJ_NAME)+" Object Exist: "+STR$(SYSOBJ EXIST(OBJ_NAME))
sync
loop
and so going by the working code above I should be able to share info right? wrong.... if I call the function listed below from the other exe I get
Runtime Error - Bank XX Already exists at line XXX
rem I am using 1 as an example
GET BANK SHARED NAME$(1)
or
GET BANK SHARED NAME$(NAME)
so my question is do I need to make some other call and could someone show me working code cause I have tried the following
1. I have tryed to unlock and lock system object IE unlock before the call then locking it after words
2. Elevating both exe's to debug status
3. Elevating both exe's to debug and linking both threads via the kernel32.dll
4. making a include with a #constant that didn't do much good cause when each exe loads the include file an exclusive memory chunk for that particular exe
one thing I did get to work is by loading the kernel32.dll and calling ReadProcessMemory the only problem with this method is every time I update or change the exe I would need to re caculate the offset to the memory I want to read
A side note you can not make more than one shared object or shared memory if you do it will error sayign the object or bank already exists
also calling GET SYSOBJ NAME$( Object Number ) from the same exe where the object does exist will error and state that the object does not exist when you can run SYSOBJ EXIST( Object Number ) and it will = 1
so I don't know whats going on I have DBP v 1.074 and xp is fully up to date