【问题标题】:Can't add function to MFC ActiveX无法向 MFC ActiveX 添加功能
【发布时间】:2012-07-28 05:01:43
【问题描述】:

我正在尝试使用 Visual Studio 2010 c++ MFC 库创建 ActiveX 组件 mfc_activeX。完成向导系统后编译没有错误。

在 Cmfc_activeXCtrl 上单击鼠标右键添加简单的新方法添加>>添加功能并填写/输出参数表单后,我得到了简单的功能:

int Cmfc_activeXCtrl::Hello(int i)
 {
 return 0;
 }

在这个过程之后,我不能再编译代码了。我有消息:

Error   85  error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets   744 6   mfc_activeX


86  IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds    c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxver_.h 81  3   

如何摆脱这些错误?

【问题讨论】:

    标签: c++ mfc activex


    【解决方案1】:

    Visual Studio 正在与一个无权运行 regsvr32 的用户一起运行,它会在成功构建后尝试注册组件。

    您可以通过以管理员身份运行 Visual Studio 来解决此问题。

    至于第二个错误

    #error Please use the /MD switch for _AFXDLL builds

    实际上,我不得不切换到另一个 /Mx 设置,然后再切换回来,所以选择以粗体显示,看来 IDE 没有正确更新。

    【讨论】:

      猜你喜欢
      • 2013-04-03
      • 2012-12-12
      • 2010-09-26
      • 1970-01-01
      • 2011-01-10
      • 1970-01-01
      • 2010-09-07
      • 2017-12-06
      • 1970-01-01
      相关资源
      最近更新 更多