> When trying to use some unmanged C++ libs in a VS 2005 Release
> Candidate Windows Forms (/clr) project, I found that any dynamic
> initialization in the lib's global STL objects (perhaps other C++
> objects as well) create an exception at startup. Has anyone seen this
> or know a workaround?
IIRC, this is due to the signature of your main function. The
managed signature, __clrcall (array<String^>^) that is, doesn't
really work right with mixed mode yet.
Just use the ordinary (int,char*[]) signature for now.
-hg
kilroytrout@gmail.com - 08 Oct 2005 18:02 GMT
Indeed that worked for a console /clr app, and I would have never
guessed that was the culprit. But I still get the exception when
linking this unmanaged lib to a Windows forms app.
For Windows Forms, I couldn't make it (int,char*[]) without a linker
error (invalid /clr entry point), but I tried main(void) and I still
get the exception. Do you have any suggestion for a WinForms app in
this scenario?
--thanks,
jeff
kilroytrout@gmail.com - 08 Oct 2005 18:15 GMT
Ok I answered my follup question to you about Winforms. I changed the
signature to int __stdcall WinMain(int,char*[]) and no more exception
the the unmanged lib's initializers.
Many thanks.
jeff