How to consume VB6 DLL from .NET?

How to use VB6 DLL from .net?

The DLL has a method called rfc that returns an array and has a parameter that is a vector of integers. How to call this dll?

Please provide examples.

var cls = new MyDllVB6.MyClassInVB6();
/*?Array?*/ = cls.MyFunctionInClass( /*?Vector of integer?*/);
+3
source share
2 answers
int[] vectorOfIntegers = new int[5];
vectorOfIntegers[0] = 123;
vectorOfIntegers[1] = 456;
.
:
int[] outputArray = cls.MyFunctionInClass(vectorOfIntegers);
+2
source

VB6 DLLs are ordinary COM DLLs, so just adding it to the project links should be enough, .NET COM interaction will do the rest for you.

+4
source

All Articles