K
Kevin Frey
I have an assembly written in C++/CLI that also links in non-clr Native C++
(the C++/CLI wraps the Native C++ functionality).
This assembly has an in-built tracing system that needs to be initialised,
amongst other things. At present the user of the assembly needs to do this
prior to invoking any other functionality, by calling a static member
function of a managed class.
I would like this initialisation to occur automatically if at all possible.
The simplest idea would be to have DllMain call the static member function,
but I believe that it is illegal to have DllMain call any managed code,
because of the mixed-mode loader lock issue.
So my question is, what alternatives exist for me to achieve my
initialisation without forcing the user of the assembly to do it explicitly?
And, a related question, when are native C++ static variables initialised in
relation to DLLMain, and initialisation of the CRT? I'm not sure if this
would help me though because of potential order-of-initialisation
consequences.
Thanks
Kevin
(the C++/CLI wraps the Native C++ functionality).
This assembly has an in-built tracing system that needs to be initialised,
amongst other things. At present the user of the assembly needs to do this
prior to invoking any other functionality, by calling a static member
function of a managed class.
I would like this initialisation to occur automatically if at all possible.
The simplest idea would be to have DllMain call the static member function,
but I believe that it is illegal to have DllMain call any managed code,
because of the mixed-mode loader lock issue.
So my question is, what alternatives exist for me to achieve my
initialisation without forcing the user of the assembly to do it explicitly?
And, a related question, when are native C++ static variables initialised in
relation to DLLMain, and initialisation of the CRT? I'm not sure if this
would help me though because of potential order-of-initialisation
consequences.
Thanks
Kevin