开发者

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开发者_JAVA技巧 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?*/);


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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜