简体   繁体   English

C#UWP app COM错误:80040154类未注册

[英]C# UWP app COM error: 80040154 Class not registered

I have an UWP application that I would like to interface with another program (Wirecast). 我有一个UWP应用程序,希望与另一个程序(Wirecast)交互。 The approach suggested by Wirecast is to call the following code: Wirecast建议的方法是调用以下代码:

    Type objClassType = Type.GetTypeFromProgID("Wirecast.Application");
    _Wirecast = Activator.CreateInstance(objClassType);

When I call this code from UWP app I get the following error: 当我从UWP应用调用此代码时,出现以下错误:

System.Runtime.InteropServices.COMException: 'Creating an instance of the COM component with CLSID {A416C15B-A073-4994-8DB5-87527A41B2FA} using CoCreateInstanceFromApp failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). System.Runtime.InteropServices.COMException:'由于以下错误,使用CoCreateInstanceFromApp创建具有CLSID {A416C15B-A073-4994-8DB5-87527A41B2FA}的COM组件实例失败:80040154类未注册(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG ))。

I checked the CLSID and it appears correctly in the Registry Editor. 我检查了CLSID,它在注册表编辑器中正确显示。 I tried compiling for x64 and x86 configurations with the same results. 我尝试编译具有相同结果的x64和x86配置。

When I try compiling this example in WPF project it works as expected . 当我尝试在WPF项目中编译此示例时, 它可以按预期工作

Is there any way to use this COM object with an UWP app? 有什么方法可以将此COM对象与UWP应用一起使用?

Unfortunately this won't work as UWP runs in a sandbox and it cannot communicate with COM. 不幸的是,由于UWP在沙箱中运行并且无法与COM通信,因此无法使用。 If you want such functionality, you would have to create a local service via which would your UWP app communicate with the program or a Brokered Windows Runtime Component which has no limitations but will prevent your app from being published to Microsoft Store. 如果需要此类功能,则必须创建一个本地服务,通过该服务,您的UWP应用可以与该程序或Brokered Windows Runtime Component通信,该服务没有任何限制,但会阻止您的应用发布到Microsoft Store。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#:DLL已注册,但COM错误80040154仍然出现 - C#: DLL is registered but COM error 80040154 still appear COMException 错误:80040154 Class 未在 microsoft.office.interop.excel.application C# 中注册 - COMException error: 80040154 Class not registered in microsoft.office.interop.excel.application C# 由于以下错误,无法为具有CLSID的组件检索COM类工厂:80040154未注册类 - Retrieving the COM class factory for component with CLSID failed due to the following error: 80040154 Class not registered 由于以下错误,为具有 CLSID {} 的组件检索 COM class 工厂失败:80040154 Class 未注册 - Retrieving the COM class factory for component with CLSID {} failed due to the following error: 80040154 Class not registered 单词互操作错误:80040154类未注册 - Word interop error: 80040154 Class not registered 80040154 Class 未注册 Outlook 2010 中的错误添加 - 80040154 Class not registered ERROR in Outlook 2010 Add In 无法获取具有 CLSID {A9E69610-B80D-11D0-B9B9-00A0C922E750} 的组件的类工厂 de COM 错误:80040154 类未注册 - Failed getting class factory de COM of component with CLSID {A9E69610-B80D-11D0-B9B9-00A0C922E750} error: 80040154 Class not Registered 检索COM类工厂失败错误:80040154 - Retrieving COM class factory failed error: 80040154 COM初始化错误0x80040154使用C ++程序加载c#COM对象 - Com Initialization Error 0x80040154 loading c# COM Object with c++ Program COM类工厂80040154服务器错误 - COM class factory 80040154 server error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM