vb怎么调用vc结构体数组?
vc提供的函数是:DIANLI_API int WINAPI My_DownLoadUsersData(int comm, char* buff, int count);
vc提供的dll中这样定义了一个结构
typedef struct user_tag{
unsigned short userID;
char name[15];
char userName[15];
char passWord[15];
unsigned char userRight;
}USER, *PUSER;
vc调用是这样的:
USER userData[] = {
{197, "0197", "zhangsan098", "123456", 255},
{198, "0198", "zhangsan099", "123456", 255}
}
memcpy(data2,userData, sizeof(USER)*2);
a = DownLoadUsersData(4,(char*)data2,2);
请问vb如何调用,如何声明,user_tag传递个数是不定的,上面vc的例子只给两条。
[解决办法]
VB中自定义类型需在类中定义才能作为函数参数传递
[解决办法]
typedef struct user_tag{ unsigned short userID; char name[15]; char userName[15]; char passWord[15]; unsigned char userRight; }USER, *PUSER;DIANLI_API int WINAPI My_DownLoadUsersData(int comm, char* buff, int count);
[解决办法]
学习