2012-09-18 1 views
1

Je reçois une exception "Classe non inscrite" lorsque j'essaie d'instancier un C# dll enveloppé par com en utilisant l'appel CreateInstance.en utilisant C# com wrapped dll en C++ throws classe non enregistrée

ci-après le trace de la pile:

'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Program Files (x86)\FlashGet\fgmgr.dll'. Module was built without symbols. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\comdlg32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wininet.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\normaliz.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\iertutil.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\urlmon.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mscoree.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sxs.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\msvcr80.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Loaded 'C:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\acfc1391e45fedd2a359778ea57d914c\mscorlib.ni.dll'. 
'Test.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Culture.dll'. Cannot find or open the PDB file. 
'Test.exe' (Win32): Unloaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\Culture.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. 
+0

Est-ce que http://stackoverflow.com/questions/93770/eefileloadexception-when-using-c-sharp-classes-in-cwin32-app aide? – nneonneo

Répondre

0

Eh bien, la classe C# COM est pas enregistré. Utilisez RegAsm.exe pour enregistrer la DLL COM C#.

+0

J'ai exécuté la commande Regasm et il en résulte que les Types sont enregistrés avec succès mais j'ai reçu les avertissements suivants st (List) Attention: Il n'y a pas de support de marshaling pour les tableaux imbriqués. – TrustyCoder

+0

Le code peut toujours fonctionner sans marshaling, mais il est généralement dangereux. Je suggère de trouver une alternative à l'utilisation de tableaux imbriqués. De toute façon, est-ce qu'il fonctionne avec succès? – user1610015

+0

Je n'ai pas le même problème aucun progrès. Je pense à écrire un wrapper personnalisé autour du code. – TrustyCoder

Questions connexes