在LhServer.dll中函数如下
typedef struct
{
char* inter_id;
char* amount;
}Titem;
int __stdcall CheckOut(int lRows, test* Titem)在VB中申明如下
private Type Titem
inter_id as string
amount as string
END Type
Public Declare Function CheckOut Lib "LhServer.dll" CheckOut(byval lRows as long, test as Titem) as long
dim t(2) as Ttiem
dim i as long
for i=1 to 2
t(i).inter_id ="id" & i
t(i).amount="mount" & i
next
CheckOut(2,titem(0)) 但现在条用后 只有一条值传递成功,后面都没有成功
请教各位那个地方引用不对
typedef struct
{
char* inter_id;
char* amount;
}Titem;
int __stdcall CheckOut(int lRows, test* Titem)在VB中申明如下
private Type Titem
inter_id as string
amount as string
END Type
Public Declare Function CheckOut Lib "LhServer.dll" CheckOut(byval lRows as long, test as Titem) as long
dim t(2) as Ttiem
dim i as long
for i=1 to 2
t(i).inter_id ="id" & i
t(i).amount="mount" & i
next
CheckOut(2,titem(0)) 但现在条用后 只有一条值传递成功,后面都没有成功
请教各位那个地方引用不对
checkOut(2,titem(0)) 传递的是 t(0),t(1) 吧!
dim i as long
for i=0 to 1
.....
应该是
typedef struct
{
char* inter_id;
char* amount;
}Titem;
int __stdcall CheckOut(int lRows, test* Titem)在VB中申明如下
private Type Titem
inter_id as string
amount as string
END Type
Public Declare Function CheckOut Lib "LhServer.dll" CheckOut(byval lRows as long, test as Titem) as long
dim t(2) as Ttiem
dim i as long
for i=0 to 1
t(i).inter_id ="id" & i
t(i).amount="mount" & i
next
CheckOut(2,titem(0))
调试一下 CheckOut,既然第一条能进去,应该是内部的问题了。