problem with singleton as lib
i got a crucial problem with my singleton class. maybe there's anybody who could help me out
i implemented a singleton framework as a static lib that handles callbacks, triggers methods etc.. next to this lib, i got several dlls that access this lib.
the problem basically is that every dll allocates its own memory and includes a copy of the lib there. so, from outside (let's say, the testing app), there's not one framework, but several according to the amount of dlls that load the framework.
as there must be only one framework, i'm looking for kind of a workaround to get rid of this "feature".
i've already tried to build the singleton as a dll which then just would be linked to the other dlls, but that didn't show any positive effect either.
so in other words, is there any memory segment (which would be the heap of the current context/process) that is used by all libraries (be it static or dynamic) that i could store at least the singleton pointer in ?
a really quick solution would be to instantiate this pointer at the testing app or create a shared memory object, but these kinds of solution don't satisfy me at all.
as i'm in an absolute rush, pls come back to me as soon as possible. thank you all very much for any hint or opinion.
best regards,
j

