ridermansb
ridermansb

Reputation: 11059

How to consume VB6 DLL from .NET?

How to consume a 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 make the call to this dll?

Please give examples.

var cls = new MyDllVB6.MyClassInVB6();
/*?Array?*/ = cls.MyFunctionInClass( /*?Vector of integer?*/);

Upvotes: 3

Views: 931

Answers (2)

Hossein
Hossein

Reputation: 4137

int[] vectorOfIntegers = new int[5];
vectorOfIntegers[0] = 123;
vectorOfIntegers[1] = 456;
.
:
int[] outputArray = cls.MyFunctionInClass(vectorOfIntegers);

Upvotes: 2

Matteo Italia
Matteo Italia

Reputation: 126787

VB6 dlls are normal COM dlls, so just adding it to the project references should suffice, the .NET COM interop will do the rest for you.

Upvotes: 4

Related Questions