I`m creating a cast of dlls that shares a single dll.
The shared lib has a Singleton.
When running, some os loaded libs make new instances of my singleton. How can I force all libs and programs using my dll use SIEMPRE one instance of my singleton?
preguntado el 28 de agosto de 12 a las 14:08
You can't just share your singleton instance between several processes. but you can use shared memory for this purpose:
The following example demonstrates how the DLL entry-point function can use a file-mapping object to set up memory that can be shared by processes that load the DLL. The shared DLL memory persists only as long as the DLL is loaded. Applications can use the SetSharedMem and GetSharedMem functions to access the shared memory.