How to share data in a same dll loaded by different process?
-
Hi, :) I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way? I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.
-
Hi, :) I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way? I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.
Hi, You should look into "shared memory" - it is relatively easy and will accomplish what you want. Try this one: http://www.codeproject.com/threads/sm.asp[^]
-
Hi, :) I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way? I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.
You can place the data into a shared data segment. Be sure to protect access to it with some sort of thread-safe synchronization mechanism.
Any sufficiently gross incompetence is nearly indistinguishable from malice.