Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to use c# assembly from my c++ code. For this i have followed these steps.

In AssemblyInfo.cs i have set the attribute ComVisible=true.
After building C# assembly, i have generated type library using following command

RegAsm DLLNAME.dll /tlb

I have imported the generated file in my C++ program.

In my TestApplication everything works fine. But when i try to move this c++ code to my MMC (Microsoft management console) dll, CoCreateInstance fails with the error code REGDB_E_CLASSNOTREG.

Why it is so, what is special about C++ dll for MMC ??
Posted
Comments
[no name] 5-Sep-13 14:02pm    
Did you register the COM component in the registry before trying to use it?
Philippe Mori 5-Sep-13 18:49pm    
Maybe that can help you: How-To Create a Hello World Snap-in
KarstenK 6-Sep-13 3:56am    
If you working with COM you NEED pay attention ot EVERY ERRORCODE. => your class isnt properly registered. So you cant create an instance.

1 solution

Try to register by /codebase option
RegAsm DLLNAME.dll /codebase
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900