gpt4 book ai didi

c++ - 无法向 MFC ActiveX 添加功能

转载 作者:行者123 更新时间:2023-11-28 08:00:02 27 4
gpt4 key购买 nike

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

通过在 Cmfc_activeXCtrl Add>>Add Function 上单击鼠标右键添加简单的新方法并填写/填写 params 表单后,我得到了简单的函数:

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

如何避免这些错误?

最佳答案

Visual Studio 正在使用无权运行 regsvr32 的用户运行,它会在成功生成后尝试注册组件。

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

关于第二个错误

#error Please use the /MD switch for _AFXDLL builds

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

关于c++ - 无法向 MFC ActiveX 添加功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11722999/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com