Shared Singleton between EXE and DLL
-
I'm using a Singleton class for some debugging work, and I have a few DLL's supporting my application. My problem is that I have a separate instance of the Singleton for each DLL and the Application. I would like them to all use the same instance of this variable. Is there some shared memory trick or something that I can implement to get around this? Thanks, Jason
-
I'm using a Singleton class for some debugging work, and I have a few DLL's supporting my application. My problem is that I have a separate instance of the Singleton for each DLL and the Application. I would like them to all use the same instance of this variable. Is there some shared memory trick or something that I can implement to get around this? Thanks, Jason
There is an article that will provide you with a work around for your problem. hope it will help you "HOWTO: Alternative Implementation of ATL Singleton" The singleton implementation in this article works around this problem by returning a marshaled pointer in IClassFactory::CreateInstance(). Famous Last Words: "TRUCK!!!"