[英]Can't add function to MFC ActiveX
我正在嘗試使用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
如何擺脫這些錯誤?
Visual Studio與一個沒有運行regsvr32的權限的用戶一起運行,該用戶嘗試在成功構建后注冊該組件。
您可以通過以管理員身份運行Visual Studio來解決此問題。
至於第二錯誤
實際上,我必須切換到另一個/ Mx設置,然后再切換回原來的選項,以粗體顯示,似乎IDE不能正確更新。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.