gpt4 book ai didi

c++ - 80040111 ClassFactory 无法提供请求的类(HRESULT 异常 : 0x80040111 (CLASS_E_CLASSNOTAVAILABLE))

转载 作者:搜寻专家 更新时间:2023-10-31 01:09:48 27 4
gpt4 key购买 nike

检索 CLSID 为 {0A80A563-28AE-11D3-9CD6-00C04F8B8EF1} 的组件的 COM 类工厂失败,原因如下:80040111 ClassFactory 无法提供请求的类(HRESULT 异常:0x80040111 (CLASS_E_CLASSNOTAVAILABLE))

我在注册表中搜索了条目,我可以在 HKLM\Software\Classes\Wow6432Node\CLSID{0A80A563-28AE-11D3-9CD6-00C04F8B8EF1}\InProcServer32

我已经通过使用嵌入式互操作类型创建了应用程序,它在本地机器上运行良好,但是当我将它部署到另一台服务器时,它会出现上述错误。

我在下面的代码行中收到提到的错误

XYZ.IApplication Sr = new Application();

我已经在我的 C# 项目中添加了对 C++ 中的 XYZ.tlb 的引用。

这是堆栈跟踪

   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly,    Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)

最佳答案

我在下面收到了同样的错误。

System.Runtime.InteropServices.COMException (0x80040111): Retrieving the COM class factory for component with CLSID {0B92B777-B6AD-435C-B9FD-804878C36E55} failed due to the following error: 80040111 ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE)).

在我的例子中,使用以下命令重新注册几次解决了这个问题。

regsvr32 {yourdllpath}\{yourdllfilename}

关于c++ - 80040111 ClassFactory 无法提供请求的类(HRESULT 异常 : 0x80040111 (CLASS_E_CLASSNOTAVAILABLE)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16602256/

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