简体   繁体   English

如何从.NET中使用VB6 DLL?

[英]How to consume VB6 DLL from .NET?

How to consume a VB6 DLL from .net? 如何从.net中使用VB6 DLL?

The dll has a method called rfc that returns an array, and has a parameter that is a vector of integers. dll有一个名为rfc的方法,它返回一个数组,并且有一个参数,它是一个整数向量。 How to make the call to this dll? 如何调用这个dll?

Please give examples. 请举例说明。

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

VB6 dll是普通的COM dll,所以只需将它添加到项目引用即可,.NET COM互操作将为您完成剩下的工作。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM