> Short answer: Managed C++ DLLs don't work yet (as of Visual Studio 2003).
>
[quoted text clipped - 29 lines]
> >
> > Tom
If you play around with compile/link settings for a while, you can get
an MC++ DLL project to build. The problem is, support for static/global
variables is broken.
Even if you don't use static/global variables directly, you probably
indirectly use some standard library functionality that does and that
will now be unstable and often crash.
http://www.codeguru.com/columns/Kate/article.php/c3643/
> I don't have a lot of experience with this yet, but I experienced the same
> thing. I got around it by just adding the library references for the
[quoted text clipped - 19 lines]
>>
>>Visual Studio 2005 hopefully will have a better solution.
William DePalo [MVP VC++] - 25 Feb 2005 17:40 GMT
> If you play around with compile/link settings for a while, you can get an
> MC++ DLL project to build. The problem is, support for static/global
[quoted text clipped - 5 lines]
>
> http://www.codeguru.com/columns/Kate/article.php/c3643/
Right. And Kate points her readers to the knowledge base article available
here:
http://support.microsoft.com/?id=814472
On the one hand I don't want to sound as though I am minimizing the problem
described there, but on the other I don't think that your characterization
of "unstable and often crash" is entirely correct, either.
The article points out that initializing the runtime and static variables
while processing the DLL_PROCESS_ATTACH notification IS a timebomb because
that is what happens by default.
However, it you mark the mixed-mode DLL as having no entry point then
prohibited actions do not take place while the loader lock is held when
loading the DLL. The article goes on to point out how to construct an
exported initializer function which clients can call _after_ having loaded
the DLL when it is safe.
Does that not tack work for you?
Regards,
Will