shared dll instance
-
Hi all, I have to create a win 32 dll which is loaded by two different processes. MSDN tells me that the dll is mapped to the process space of the calling exe and so there would be two instances of the dll running. The problem is that the dll which I have to create keeps doing some processing on a hardware board. Does it mean that both instances of my dll will keep on doing these operations parallely on the board? If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it. Any pointers in this direction and how to create a single shared instance of dll will be very helpful.
-
Hi all, I have to create a win 32 dll which is loaded by two different processes. MSDN tells me that the dll is mapped to the process space of the calling exe and so there would be two instances of the dll running. The problem is that the dll which I have to create keeps doing some processing on a hardware board. Does it mean that both instances of my dll will keep on doing these operations parallely on the board? If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it. Any pointers in this direction and how to create a single shared instance of dll will be very helpful.
misha_grewal wrote:
If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it.
you have to look for Synchronization classes here :- http://www.codeproject.com/threads/Synchronization.asp[^] http://www.codeproject.com/threads/semaphores.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV
-
Hi all, I have to create a win 32 dll which is loaded by two different processes. MSDN tells me that the dll is mapped to the process space of the calling exe and so there would be two instances of the dll running. The problem is that the dll which I have to create keeps doing some processing on a hardware board. Does it mean that both instances of my dll will keep on doing these operations parallely on the board? If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it. Any pointers in this direction and how to create a single shared instance of dll will be very helpful.
We see the very common MFC as shared dll option in our projects. Does this option mean than only one instance of the MFC dll would be running on the system? What happens behind when create a MFC shared dll?Can I use the same technique to create a shared dll? Thanks in advance. Your responses are truly appreciated..
-
We see the very common MFC as shared dll option in our projects. Does this option mean than only one instance of the MFC dll would be running on the system? What happens behind when create a MFC shared dll?Can I use the same technique to create a shared dll? Thanks in advance. Your responses are truly appreciated..
misha_grewal wrote:
Does this option mean than only one instance of the MFC dll would be running on the system? What happens behind when create a MFC shared dll
Yes there be only one Instance loaded in memory, and every function has it address, using which we can make the call to the function!.
misha_grewal wrote:
What happens behind when create a MFC shared dll
there is lot of difference between shared MFC DLL and Dll you are creating... actually your problem is syncronization not sharing... actually here Shared mean that Application will use MFC dll previously loaded OS.. and BTW I believe MFC dll itself use Syncronization technique like Mutex,events etc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV