Click here to Skip to main content
15,882,163 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to make a dll in vb2008 and use it like dll reference in vb6.


I was looking and i found many reference where the dll created in vb2008 must be registered.

Someone knows?

What I have tried:

I tried the register the dll and import it from vb6.
Posted
Updated 4-Sep-20 4:37am

1 solution

You have to make sure your .net object is COM compatible

Exposing .NET components to COM | Microsoft Docs[^]

(you might have to double-check what interfaces you need for vb6 to use it properly, it may need IDispatch, I forget), then you have to register the dll which is just how COM works, it is registry-based and the registration process creates the required registry entries, and from there you should be able to add a reference to it from VB6. Obviously the target machine will also need everything available that the .net object needs, and you need to be careful about what types you are using as parameters.
 
Share this answer
 
Comments
Richard Deeming 4-Sep-20 10:51am    
From what I've seen, you should be able to use a "registration-free" COM object from VB6.
Registration-Free COM Interop | Microsoft Docs[^]
F-ES Sitecore 4-Sep-20 11:49am    
Is that not for when .net is the consumer of the COM object though?
Richard Deeming 4-Sep-20 11:53am    
I think it works the other way too - for example:
com interop - vb.NET DLL Registration Free COM with VB6 - Stack Overflow[^]
F-ES Sitecore 4-Sep-20 11:59am    
That's clearer, you add a manifest file to the vb exe which the underlying COM system natively knows how to process. Not sure that would work when developing a VB6 app though, it looks like something that helps you deploy the app after it has been developed such that you don't need to register your COM components.

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