问题1:
把下面的在delphi 中声明:
1.BOOL WINAPI TA_Init(char *IP , short port , unsigned short SysCode, unsigned short TerminalNo, bool *ProxyOffline, ULONG *MaxJnl)是这样吗???
function TA_Init(ip:pchar;port:;SysCode:Byte;TerminalNo:Byte;??;??) : integer; stdcall;?? 应该填写什么??
2.c++ unsigned int 和 short 对应delphi 的什么??谢谢各位指点
把下面的在delphi 中声明:
1.BOOL WINAPI TA_Init(char *IP , short port , unsigned short SysCode, unsigned short TerminalNo, bool *ProxyOffline, ULONG *MaxJnl)是这样吗???
function TA_Init(ip:pchar;port:;SysCode:Byte;TerminalNo:Byte;??;??) : integer; stdcall;?? 应该填写什么??
2.c++ unsigned int 和 short 对应delphi 的什么??谢谢各位指点
第一个问题是这样吗
1.BOOL WINAPI TA_Init(char *IP , short port , unsigned short SysCode, unsigned short TerminalNo, bool *ProxyOffline, ULONG *MaxJnl) 函数功能: 初始化第三方动态库入口参数: IP-第三方代理服务器SIOS的IP地址, port-第三方代理服务器sios 的端口号SysCode-给第三方系统分配的系统代码,TerminalNo - 终端编号出口参数: ProxyOffline-代理服务是否脱机 MaxJnl – 最大流水号返 回 值: TRUE/FALSE例 子: bool bOffline;
ULONG uJnl;
BOOL bRet = TA_Init("127.0.0.1" , 8500 , 20 ,1, &bOffline, &uJnl);
short 相当于Smallint
ULONG uJnl;
BOOL bRet = TA_Init("127.0.0.1" , 8500 , 20 ,1, &bOffline, &uJnl);
如果调用 是否这样??var
Offline:bool;
Jnl:Cardinal;
begin
TA_Init((‘127.0.0.1’ , 8500 , 20 ,1, @Offline,Jnl);
var
Offline:bool;
Jnl:DWORD;
begin
TA_Init((‘127.0.0.1’ , 8500 , 20 ,1, @Offline,@Jnl);
var
cardNO : longword;
AccountMsg : TAccountMsg;
Offline:bool;
Jnl:PDWORD;
begin
TA_Init('202.116.170.29' , 8500 , 40 ,2, @Offline,@Jnl);
TA_CRInit( 0, 0 , 9600);
TA_CRBeep(100);
Label1.caption:= AccountMsg.name;
fillchar(AccountMsg, sizeof(AccountMsg), #0);
TA_FastGetCardNo(@CardNo); //读卡号
AccountMsg.StudentCode :='30002761'; //!!!! 执行这句就报错!!!!!!!
Label1.caption:=inttostr(cardNO); //传出卡号
TA_InqAcc(@AccountMsg,20);
end;AccountMsg.StudentCode :='30002761'; //!!!! 执行这句就报错!!!!!!!
**************************************************************************
AccountMsg 的结构是://*帐户信息包*/
type
pAccountMsg = ^TAccountMsg;
TAccountMsg = packed record
Name : array[0..20] of char; //姓名
sexNo : array[0..1] of char; //性别:1-女,其他为“男”
DeptCode:array[0..18] of char; // 部门代码
AccountNo: longword; //帐号
CardNo: longword;//卡号
StudentCode : array[0..20] of char; //学工号
IDCard : array[0..20] of char; //身份证号
end;
TA_InqAcc 的函数为:
function TA_InqAcc(AccountMsg:pAccountMsg;TimeOut:integer) : integer; stdcall;
错误为:
Project Project1.exe raised exception class EAccessViolation with message'Access
violation at address 0000005B4.Read of address 0000005B4'.Process stopped.Use Step
or Run to continue.请问哪里出错了?!谢谢
short 相当于Smallint
var
Offline:bool;
Jnl:DWORD;
begin
TA_Init((‘127.0.0.1’ , 8500 , 20 ,1, @Offline,@Jnl);
Delphi中@取地址,^取值