高分求教各位兄弟姐妹 C语言写了一个DLL,有个函数有结构体(struct)为形参,当VB使用这个函数时 如何对这个以结构体为形参的变量赋值? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Type yourStruct a as long b as integer c as byteEnd Type 需要看看你的struct的C的原型再看看怎么转换到VB 如果C结构体是嵌套了多层的结构的结构体 在VB中难道也是Type的多层嵌套吗?我把Type的多层嵌套发给DLL的接口函数,无法通过 提示:DLL调用约定错误。例如:C结构体struct A{ struct B { struct C { ...... } ...... } ......}vb的type我也是仿造上面结构体也进行了Type的嵌套 但是在传给接收该结构体的DLL形参时,总是提示DLL调用约定错误,不知道是什么回事? typedef struct { uword32 commandLength; uword32 commandID; uword32 commandStatus; uword32 sequenceNo; }MESSAGE_HEAD_T;typedef struct{ uword8 sourAddrTon; uword8 sourAddrNpi; uword8 sourAddrLen; uword8 sourAddr[21]; uword8 destAddrTon; uword8 destAddrNpi; uword8 destAddrLen; }MESSAGE_BODY_T;typedef struct{ MESSAGE_HEAD_T messageHead; MESSAGE_BODY_T messageBody; }SUBMIT_SM_REQ_T;typedef struct{ MESSAGE_HEAD_T messageHead; uword8 messageID; } DELIVER_SM_RSP_T;最后作为DLL函数的接口的结构是typedef struct { uword8 opCode; union { SUBMIT_SM_REQ_T submitSmReq; DELIVER_SM_RSP_T deliverSmRsp; }SendMessage;}SEND_MESSAGE_T; 为新手指指路吧(vb程序与数据库中数据的连接) 如何判断一个文本文件是否存在呢? 关于vb数据库(access)中报表的问题! 为什么会下标越界 如何编写代理软件,实现IE-internet选项--连接--代理服务器的功能 ? 关于转换人民币大写的程序,谁有现成的VB源代码吗?谢谢!! 如何颠倒字符串的次序?ABCD-DCBA VB的COM组件在服务器中的应用 很难开口的问题! API:目录??? 急求各位兄弟,VB中的DTPicker中的时间转换为字符串的问题? 我买了一张vb6中文版的盘,为什么没有关于数据库acess的东东?
a as long
b as integer
c as byte
End Type
例如:C结构体
struct A
{
struct B
{
struct C
{
......
}
......
}
......
}vb的type我也是仿造上面结构体也进行了Type的嵌套 但是在传给接收该结构体的DLL形参时,总是提示DLL调用约定错误,不知道是什么回事?
{
uword32 commandLength;
uword32 commandID;
uword32 commandStatus;
uword32 sequenceNo;
}MESSAGE_HEAD_T;typedef struct
{
uword8 sourAddrTon;
uword8 sourAddrNpi;
uword8 sourAddrLen;
uword8 sourAddr[21];
uword8 destAddrTon;
uword8 destAddrNpi;
uword8 destAddrLen;
}MESSAGE_BODY_T;typedef struct
{
MESSAGE_HEAD_T messageHead;
MESSAGE_BODY_T messageBody;
}SUBMIT_SM_REQ_T;typedef struct
{
MESSAGE_HEAD_T messageHead;
uword8 messageID;
} DELIVER_SM_RSP_T;最后作为DLL函数的接口的结构是
typedef struct
{
uword8 opCode;
union
{
SUBMIT_SM_REQ_T submitSmReq;
DELIVER_SM_RSP_T deliverSmRsp;
}SendMessage;}SEND_MESSAGE_T;