【问题标题】:MFC: Visual Studio 2019 says The ActiveX control could not be instantiated?MFC:Visual Studio 2019 提示无法实例化 ActiveX 控件?
【发布时间】:2021-10-06 09:10:03
【问题描述】:

我从未处理过 ActiveX 控件,但我想使用 VS2019 将一个添加到现有的 MFC 项目中。我在资源编辑器中创建了一个对话框,添加了我想玩的 ActiveX 控件(RDP - 尝试了不同的版本),调整了它的大小。然后关闭选项卡,当我尝试在资源编辑器中打开该对话框时,我得到:

---------------------------
Microsoft Visual Studio
---------------------------
The ActiveX control "Microsoft RDP Client Control (redistributable) - version 11" could not be instantiated.
---------------------------
OK   
---------------------------

出了什么问题,我该如何解决?

另外,那些说(可再发行)与没有说(可再发行)的有什么区别?

TIA!!

附:在上述错误之后,如果我再次尝试打开,我会得到:

An error occurred while initializing the frame's content
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowPaneDocumentObject.Init(Boolean initSize)
   at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject(Object punkView)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.InitializeDocumentSite(Boolean creatingStubFrame, Boolean replacingStubView, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame)


File Path: Path\To\Resource.rc
Frame GUID: 177559e0-d141-11d0-92df-00a0c9138c45
Frame mode: VSFM_Float
Error Code: 0x80004005

【问题讨论】:

  • 您可能需要在regsvr32 注册它吗? ActiveX 对象有各种各样的怪癖,是一种非常不安全和过时的技术;如果你能跑得离它很远,试试另一种方法。
  • 它是从应用程序内部提供 RDP,我认为他们没有任何东西可以像 API 接口那样替代它吗?还是他们?
  • 这种方法适用于旧项目/环境(VS2017)?你试过在其他机器上运行这个项目吗?也许您会发现缺少的组件...

标签: visual-studio mfc activex resource-editor


【解决方案1】:

这将在 KB900411 中修复

【讨论】:

    猜你喜欢
    • 2010-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-16
    • 2014-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多