在VB中定义一个与dll中完全相同的数组,在vb中付值。申明方式如下--vb中--Private Declare sub test Lib "*.dll" (ByRef csDate As taga)type taga dim a as long end typetaga.a=2--vc中-- 比如说是test函数的参数 struct taga { int a; } test(taga *tagatest) { }注意点 1,vb中必须ByRef a As taga或者a As taga,这样申明。省略byref指示符时,vb中的默认申明为byref,与此相对的是byval。前者相当于传址,后者是传值。申明数组时,不能传值。 2,根据1,在vc中就应该申明为数组指针。 3,这个可能你也知道向vb中输出函数时,规定的调用约定为__stdcall
dim a as long
end typetaga.a=2--vc中--
比如说是test函数的参数
struct taga
{
int a;
}
test(taga *tagatest)
{
}注意点
1,vb中必须ByRef a As taga或者a As taga,这样申明。省略byref指示符时,vb中的默认申明为byref,与此相对的是byval。前者相当于传址,后者是传值。申明数组时,不能传值。
2,根据1,在vc中就应该申明为数组指针。
3,这个可能你也知道向vb中输出函数时,规定的调用约定为__stdcall