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.开发者_开发技巧
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.
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.
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.
精彩评论