Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/152.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ mscorlib.dll中发生类型为“System.Runtime.InteropServices.COMException”的未处理异常_C++_Dll_Registration - Fatal编程技术网

C++ mscorlib.dll中发生类型为“System.Runtime.InteropServices.COMException”的未处理异常

C++ mscorlib.dll中发生类型为“System.Runtime.InteropServices.COMException”的未处理异常,c++,dll,registration,C++,Dll,Registration,mscorlib.dll中发生System.Runtime.InteropServices.COMException类型的未处理异常 其他信息: Retrieving the COM class factory for component with CLSID {613997F9-F489-4051-ACCB-1C7AE9C9E9A6} failed due to the following error: 80040154 Class not registered (Exception from

mscorlib.dll中发生System.Runtime.InteropServices.COMException类型的未处理异常

其他信息:

Retrieving the COM class factory for component with CLSID {613997F9-F489-4051-ACCB-1C7AE9C9E9A6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
我在Visual Studio 2013社区中遇到此错误

我有一些本地C++代码,我把它们编译成X64调试DLL。 然后,在这些DLL之上,我使用ATL构建COM项目,以公开一些带有接口的功能。COM仅生成为x64调试dll版本。在生成后事件中,我添加%WinDir%\system32\regsvr32/s/c$TargetPath以注册我的COM。我很确定所有链接器和其他选项在项目设置中都设置得很好。这个COM dll也构建得很好。编译后,我可以看到新的typelib已经注册

但是,当我添加一个VB.net或C winform应用程序来测试COM时,winform只是在COM中提供一些输入和调用方法,我遇到了这个错误

我知道这个问题已经讨论过很多次了,但似乎所有的讨论都不是我的解决方案。以前的讨论最像是32位、64位混淆和其他问题

我可以从注册表中看到以下注册表项名称:

HKEY_CLASSES_ROOT\CLSID\{613997F9-F489-4051-ACCB-1C7AE9C9E9A6}
HKEY_CLASSES_ROOT\CLSID\{613997F9-F489-4051-ACCB-1C7AE9C9E9A6}\InprocServer32
HKEY_CLASSES_ROOT\CLSID\{613997F9-F489-4051-ACCB-1C7AE9C9E9A6}\Programmable
HKEY_CLASSES_ROOT\CLSID\{613997F9-F489-4051-ACCB-1C7AE9C9E9A6}\TypeLib
HKEY_CLASSES_ROOT\CLSID\{613997F9-F489-4051-ACCB-1C7AE9C9E9A6}\Version
我还可以看到InProcServer32键显示了COM dll的正确路径

我的计算机是64位计算机,操作系统是Windows 8.1


有人有什么想法吗?

使用SysInternals的过程监视器进行故障排除。标准原因是您忘记删除抖动强制,因此.NET程序以32位模式运行。我重新构建了一个32位版本,它工作正常。我