Is there a known problem with the boost::mutex header when used inside an ActiveX control?
(Boost version v1.39)
If I create an MFC ActiveX Control project in Visual Studio 2008 called "DefaultOCXControl" then I can build it, the control registers itself as part of the build, and can be inserted into the ActiveX Test Container as you would expect. All good.
If I then just add this line:
#include <boost/thread/mutex.hpp>
at the top of my DefaultOCXControlCtrl.h
file and rebuild: the registration step at the end of the build fails with:
Debug Assertion Failed!
Program: C:\Windows\system32\regsvr32.exe
File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dllinit.cpp
Line: 587
The offending assertion looks like this:
void AFXAPI AfxCoreInitModule()
{
ASSERT(AfxGetModuleState() != AfxGetAppModuleState());
...
Attempting to insert the control into the ActiveX Test Container now results in the same message. If I remove the line and rebuild then everything is fine - so it definitely seems to be something in that header file that causes the issue.
_pRawDllMain
, discussed on the boost mail archive here: lists.boost.org/threads-devel/2009/06/0476.php I migrated our static library that was using boost::thread to a DLL instead and that sorted the issue. – Mandamus