添加的#include<升压/线程/ mutex.hpp>打破我的ActiveX控件? [英] Adding #include <boost/thread/mutex.hpp> breaks my ActiveX control?

查看:169
本文介绍了添加的#include<升压/线程/ mutex.hpp>打破我的ActiveX控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否与ActiveX控件内使用时的boost ::互斥锁头一个已知的问题?结果
(加速版v1.39)

如果我创建的 MFC ActiveX控件的名为DefaultOCXControlVisual Studio 2008的项目中的控制寄存器本身作为构建的一部分的话,我可以建造它,和可插入的ActiveX测试容器如你所愿。所有优秀的。

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>

我的 DefaultOCXControlCtrl.h 文件和重建的顶部:在构建末端的注册步骤失败:

at the top of my DefaultOCXControlCtrl.h file and rebuild: the registration step at the end of the build fails with:

调试断言失败!结果
  程序:C:\\ WINDOWS \\ SYSTEM32 \\ regsvr32.exe的结果
  文件:F:\\ DD \\ vctools \\ vc7libs \\船舶\\ atlmfc的\\ src \\ MFC \\ dllinit.cpp结果
  行:587

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());
    ...

试图插入控件插入的ActiveX测试容器现在结果相同邮件中。如果我删除线,然后重建一切都很好 - 所以它肯定似乎有什么东西在这导致的问题,头文件

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.

推荐答案

你试过链接的boost ::线程动态(定义BOOST_THREAD_DYN_LINK)?

Have you tried linking boost::thread dynamically (define BOOST_THREAD_DYN_LINK)?

我使用的时候有这样那样的问题的boost ::线程与混合C ++ /。NET项目和链接只是的boost ::线程动态是解决(这里可能的解释:<一href=\"http://article.gmane.org/gmane.comp.lib.boost.user/22617/match=clr\">http://article.gmane.org/gmane.comp.lib.boost.user/22617/match=clr)

I had this kind of problems when using boost::thread with a mixed C++/.NET project and linking just boost::thread dynamically was the solution (here a possible explanation: http://article.gmane.org/gmane.comp.lib.boost.user/22617/match=clr)

这篇关于添加的#include&LT;升压/线程/ mutex.hpp&GT;打破我的ActiveX控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆