Azhar
Azhar

Reputation: 20670

can we use Vb6 generated dlls in .net 3.5 prioject?

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

Answers (3)

Phil Hunt
Phil Hunt

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

Andrew Hare
Andrew Hare

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

Darin Dimitrov
Darin Dimitrov

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

Related Questions