Reputation: 20670
I have a requirement to use VB6 generated dlls in .Net code but I am confused because compilation of both are differnet. and I am not sure that if .Net run time refuse to use VB6 dlls.
Upvotes: 0
Views: 647
Reputation: 8521
You can reference an ActiveX (COM) DLL produced from VB6 (and registered using regsvr32
) by adding a reference to the the component on the COM tab of the Add Reference dialog in your .NET project. Visual Studio will generate the required interop layer for you.
Upvotes: 4
Reputation: 351516
The dlls that the VB6 compiler generates are very different from the assemblies (also confusingly called dll's) that a .NET compiler generates.
You will not be able to call them directly without an interop layer.
Upvotes: 0
Reputation: 1038790
VB6 dlls are not .NET assemblies and are very different in nature (unmanaged vs managed code) so you cannot use them directly. You need PInvoke or COM interop.
Upvotes: 0