在 C++ 中使用 C# COM 包装的 DLL 会抛出未注册的类
using c# com wrapped dll in c++ throws class not registered
当我尝试使用 CreateInstance 调用实例化由 com 包装的 c# dll 时,我收到"类未注册"异常。
以下是堆栈跟踪:
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64ntdll.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64kernel32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64KernelBase.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64ole32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64msvcrt.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64gdi32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64user32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64advapi32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64sechost.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64rpcrt4.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64sspicli.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64cryptbase.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64lpk.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64usp10.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64oleaut32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64msvcr110d.dll'. Symbols loaded.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64msvcp110d.dll'. Symbols loaded.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64imm32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64msctf.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64uxtheme.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:Program Files (x86)FlashGetfgmgr.dll'. Module was built without symbols.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64comdlg32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64shlwapi.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:Windowswinsxsx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149afcomctl32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64shell32.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64version.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64wininet.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64normaliz.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64iertutil.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64urlmon.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64clbcatq.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64mscoree.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsMicrosoft.NETFrameworkv4.0.30319mscoreei.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64sxs.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsMicrosoft.NETFrameworkv2.0.50727mscorwks.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:Windowswinsxsx86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9amsvcr80.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsSysWOW64profapi.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Loaded 'C:WindowsassemblyNativeImages_v2.0.50727_32mscorlibacfc1391e45fedd2a359778ea57d914cmscorlib.ni.dll'.
'Test.exe' (Win32): Loaded 'C:WindowsMicrosoft.NETFrameworkv2.0.50727Culture.dll'. Cannot find or open the PDB file.
'Test.exe' (Win32): Unloaded 'C:WindowsMicrosoft.NETFrameworkv2.0.50727Culture.dll'
First-chance exception at 0x75E7B9BC in Test.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x004BDACC.
First-chance exception at 0x75E7B9BC in Test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
First-chance exception at 0x75E7B9BC in Test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
First-chance exception at 0x75E7B9BC in Test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
好吧,C# COM 类未注册。使用 RegAsm.exe 注册 C# COM DLL。
相关文章:
- 如何在C++非托管/本机 DLL 中从注册免费 COM C# 托管 DLL 创建 COM 对象
- 可视化 使用 C++ API 注册 COM DLL 的所有接口
- 如何查找 dll 注册失败的原因
- 注册和调用 DLL 回调的正确方法是什么
- 在同一DLL中使用_COM_SMARTPTR CreateInstance而不进行注册
- 如何为64位应用程序注册.NET DLL
- 在Windows Server 2003中注册dll时出现问题
- C++:无法使用 regsvr32 注册我的 DLL,但可以通过 IDE 工作
- 在多个DLL中注册常见的Qt元类型
- 是否有必要注册DLL来使用它
- 为使用C# /托管代码的无注册COM Interop设置DLL
- 如何在不同的目标平台上以编程方式智能注册 32 位 COM/DLL 组件
- 在 C++ 中使用 C# COM 包装的 DLL 会抛出未注册的类
- 将Dll注册到特定路径
- 在LOCAL_MACHINE中注册Dll
- 在运行程序之前加载/注册DLL
- 无法在其他计算机上注册C++MFC dll
- DLL 注册返回代码0x80029c4a
- 如何在 Windows11(x7) 上使用 EPM 一次将 64 个浏览器帮助程序对象 dll 注册到 IE7 中
- Cython:在DLL中注册用于回调的Python函数