Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
__SharedMemory, seperate .exe
#1
If run below sm_A... and it will output "test"

But now I remove the last line from 'sm_A...'  -> sm_B_example  and if I then compile both sm_A and sm_B to .exe and first run sm_A and after that sm_B then
nothing will be output. I guess this is because sm_B is not run within the same thread/session.

My question:
Is the above still possible?
2 seperate .exe, example: exe1.exe and exe2.exe
exe1 put's data in memory.
exe2 retrieves it.

EDIT:
There are other methods like clipboard or textfile but I was hoping there is another way for this without using the clipboard or a textfile.
My request is probably not possible due to security issues and such but I thought i'd ask anyway.

Macro sm_A_example
Code:
Copy      Help
__SharedMemory sm1
str r="TEST"
int dwMemSize=r.len+2
lpstr m=sm1.Create("Local\X1234" dwMemSize)
lstrcpyn m r dwMemSize
sm_B_example


Function sm_B_example
Code:
Copy      Help
__SharedMemory sm2
lpstr m=sm2.Open("Local\X1234")
out m
sm2.Close
#2
Shared memory exists as long as one or more processes have it open. If exe1 exits or closes the memory before exe2 tries to open it, the memory already does not exist. Let exe1 run all the time. Or use a file or registry.
#3
Ah makes sense!
Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)