How can I reference a com visible C# dll in a vb6 library project using a manifest?

751 Views Asked by At

I have a c# com visible dll and I want to call this dll in vb6 project, which also generates a dll.I am not using regasm.exe to do this call, instead of that I am using manifest generation for the c# dll and then creating its tlb and calling it from vb6.

I have created two interfaces in c# dll one is Itest and another is Itest2,made both interfaces comvisible and added Guid to both interfaces,there are two classes named testimp and classimp which implement both the interfaces respectivly.These both classes are comvisible, Classinterface type as none and have their respective GUID.

The problem is that I am able to instantiate only testimp class from my vb6 project not classimp class.

2

There are 2 best solutions below

3
On

COM registrations are usually referenced from the TLB GUID - which is to be registered in the registry

Note that on Windows Vista and up (IIRC) it's also possibly to deploy with application-local COM registrations in a .manifest file:

0
On

If your problem is per user install, use Regasm to create a regfile, then edit the regfile to change references to HKCR to HKCU\Software\Classes.