0

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.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
raunak
  • 29
  • 1
  • 11
  • VB6 is **very** hostile to any attempt to make a manifest work. Chief problems are that it doesn't directly support embedding the manifest as a resource and that a manifest cannot work when you use the VB6 IDE to debug. The only shot you have at this is to only try this *after* you've debugged and tested your code and are ready to deploy. Use mt.exe to embed the manifest as resource ID #2 in the VB6 dll. And do consider that you *still* need to register the VB6 dll so it can be found by the client program so you are not actually ahead. – Hans Passant Nov 24 '14 at 11:43
  • Typically if you compile your comvisible C# DLL in Visual Studio, it is automatically registered if the "register for COM interop" option is selected in the project settings. Then you can just reference it in VB6. – StayOnTarget Jan 08 '19 at 14:22
  • Possible duplicate of [Including .NET assemblies in a VB6 manifest?](https://stackoverflow.com/questions/9164660/including-net-assemblies-in-a-vb6-manifest) – StayOnTarget Jan 21 '19 at 12:57

2 Answers2

1

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:

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633
  • could you please elaborate the last line of your answer ? – raunak Nov 24 '14 at 10:17
  • I think you need to elaborate on your goal/trouble first. The last line is a hyperlink, it's self-explanatory. On SO we can help people who are stuck with concrete steps in a solution. – sehe Nov 24 '14 at 10:19
  • I have edited the whole question.Hope this may explain my trouble clearly. – raunak Nov 24 '14 at 10:46
0

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.