Class not registered ... when trying to call a managed C # library from unmanaged C ++
I have a C # library that I am using for a COM object in unmanaged C ++ code. I registered the library using the Visual Studio "Register For Com Interop" checkbox and set ComVisible to true.
imported tlb into c ++ app ..... when i run it i get "class not registered" ....
This worked before, but it started after I moved my C # project directory to a different location .... yes, I re-registered the library after I moved it.
I removed all references from the registry ... I even tried to do gacutil.exe / i on it ... boneless.
Does anyone know how to fix this?
source to share
If you do not have an explicit CLSID set on the managed object, it is possible that the move and rebuild created a new CLSID. Make sure your unmanaged project does not have an outdated copy of typelib.
Go to HKCR \ CLSID \ {XXXX} and verify that the class registration for the managed object points to the correct managed DLL.
source to share