delphi调用VC动态库报错,请大家帮忙看看

lihongling0994 2009-12-14 05:32:25
VC动态库的接口函数:
int Query_Pos_Card12(HANDLE icdev,LPINT CardType, LPINT Opt_Num, LPINT Serno,LPSTR Cardno,
unsgind long * CardSerno, LPINT Value,LPINT Count,LPINT UserType,,LPINT Consum_Add, LPINT use_term ,
int WaitTime)

delphi的调用函数:
Function Query_Pos_Card12(icdev : longint ;CardType : PINT ;Opt_Num : PINT ;Serno : PINT ;
Cardno : LPSTR ;CardSerno : PUINT ;Value : PINT ;Count : PINT ;UserType : PINT ;
varConsum_Add : PINT ;use_term : PINT ; WaitTime : integer):smallint; stdcall;
far;external 'yccard.dll' name 'Query_Pos_Card12';

我调用的代码:
var
i : integer;
CardType : PINT;
Opt_Num : PINT;
Serno : PINT;
Cardno : LPSTR;
CardSerno : PUINT;
Value : PINT;
Count : PINT;
UserType : PINT;
Consum_Add : PINT;
use_term : PINT;
begin
{Query_Pos_Card12(icdev : longint ; CardType : PINT ; Opt_Num : PINT ; Serno : PINT ;
Cardno : LPSTR ; CardSerno : LPUINT ; Value : PINT ; Count : PINT ; UserType : PINT ;
Consum_Add : PINT ; use_term : PINT ; WaitTime : integer) }
i := Query_Pos_Card12(icdev , CardType , Opt_Num , Serno , Cardno , CardSerno , Value , Count , UserType , Consum_Add , use_term , 500);
showmessage(inttostr(i));
end;


问题是我一调用就报内存错误,我估计是参数类型不匹配,但是我哪里出错的呢,我又找不到,请大家帮我看看
...全文
143 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluegloom 2009-12-29
  • 打赏
  • 举报
回复
你的qq告诉我
bluegloom 2009-12-29
  • 打赏
  • 举报
回复
楼主在吗,我的qq是406179485,加我啊
Seamour 2009-12-14
  • 打赏
  • 举报
回复
stdcall -> cdecl
SmallInt -> Integer
别的懒得仔细看了
hahazaiha 2009-12-14
  • 打赏
  • 举报
回复
得先知道HANDLE ,PUINT 等 在VC里面是什么类型 然后在你的调用函数里用相应的类型代替,应该没什么问题
林石公 2009-12-14
  • 打赏
  • 举报
回复
LPSTR似乎应当对应PChar
hahazaiha 2009-12-14
  • 打赏
  • 举报
回复
把你的动态库发上来试试

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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