From: dps on
Hi all,

as far as I know static variables in a dll are initialized when the
dll is loaded. I have the following situation: my executable links
with a dll from which I use nothing explicitly. When the statics are
initialized, a function is registered with a map in another dll. If I
don't call a function from the first dll nothing is registered, as the
statics do not get initialized. Is there a way (and possibly platform-
independent) to initialize the statics in a dll without using anything
from it?

thanks a lot!
From: Nobody on
"dps" <servisster(a)gmail.com> wrote in message
news:ecae04ce-ad56-4dff-94bd-d5ac6fb44c50(a)g26g2000yqn.googlegroups.com...
> Hi all,
>
> as far as I know static variables in a dll are initialized when the
> dll is loaded. I have the following situation: my executable links
> with a dll from which I use nothing explicitly. When the statics are
> initialized, a function is registered with a map in another dll. If I
> don't call a function from the first dll nothing is registered, as the
> statics do not get initialized. Is there a way (and possibly platform-
> independent) to initialize the statics in a dll without using anything
> from it?

Use LoadLibrary(), or add a dummy Init() function so the DLL is loaded when
you call it.