bad dll calling convention

wyarrant 2003-08-11 10:11:19
一个dll文件,我在vc中调用成功
extern "C" __declspec(dllimport) LONG DevOpen ( char* DevName, ULONG FAR * Hdl,ULONG Op, char* ID, SHORT DT, ULONG Rd);
怎么才能在vb中正确调用呢?
我在VB中按下面的声明,调用的时候报错:
run time error:bad dll calling convention

Private Declare Function DevOpen Lib "testapi" (ByVal DevName$, ByVal handle&, Op As Any, ByVal Id$, DT As Any, Rd As Any) As Long

执行到调用
Dim test As Long
Dim ph As Long
test = XSPMOpen("TET", ph, 0, "TT", -1, 0)
...全文
94 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyl910 2003-08-12
  • 打赏
  • 举报
回复
any只对于需要传送多种数据类型的时候使用

找不到对应类型的时候绝对不能用any
wyarrant 2003-08-12
  • 打赏
  • 举报
回复
似乎不对阿~~~~~还是那个错误~~~
James0001 2003-08-12
  • 打赏
  • 举报
回复
必须用 __stdcall

还有,
Private Declare Function DevOpen Lib "testapi" (ByVal DevName as string, byref handle as long, byval Op As long, ByVal Id as string, byval DT As integer,byval Rd As long) As Long

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧