急!!!请各位大侠帮忙看看PB声明外部函数???
小月云 2012-10-13 11:03:17 Delphi 语法:
function BatchReadRecord(hPort: THandle; var Records: array of TICRecord{; ArraySize: Integer}): Integer; stdcall; external ER_API
//参数说明:
// hPort : 端口句柄, 需要联机
// Records : 返回记录数组, 最少需要16个单元
// ArraySize : Delphi不需要,如果是VB或是C++需要传数组大小参数
//返回值:
// -1 : 错误
// 0 : 记录已经读完
// 1-16 : 正确读取的记录条数
//批读记录结构
type
PICRecord=^TICRecord;
TICRecord=packed record
Card: array[0..19] of char; // 卡号字符串
timeString: array[0..19] of char; // 14位刷卡时间字符串, 格式为yyyymmddhhnnss
EmpId: array[0..9] of char;
mark: Integer; // 读卡机标识字符
flag: Integer; // 存储卡的结果
cardTimes: Integer; // 发卡次数, 0-15
consume : Integer; // 消费额
balance : Integer; // 消费后余额
pos_sequ: Integer; //消费流水号
order_id: Integer;//卡重复使用序号
OrderMonth : Integer; //订餐月
OrderDay : Integer; //订餐日
Dins1 : Integer; //订餐1
Dins2 : Integer; //订餐2
Month1 : Integer; //月份1
Month2 : Integer; //月份2
reserved1: DWORD; // 983返回的是状态
reserved2: DWORD; // 860返回的是班次
reserved3: array[0..19] of Char; // 保留
reserved4: array[0..100] of Char; // 机上原始数据
end;
我的PB写法:
Declare Global external Functions
function ulong BatchReadRecord(ulong hPort,ref TICRecord records,uint arraysize) Library "ER.DLL"
建立全局结构:
structure TICRecord
string card[20]
string timestring[20]
string empid[10]
long mark
long flag
long cardtimes
decimal{2} consume
decimal{2} balance
long pos_sequ
long order_id
long OrderMonth
long OrderDay
long Dins1
long Dins2
long Month1
long Month2
ulong reserved1
ulong reserved2
string reserved3[20]
string reserved4[101]
代码:
ulong hPort,lui_ret
uint arraysize=20
TICRecord Records
lui_ret = BatchReadRecord(hPort,Records,arraysize)
为什么总报以下错误???
Error C0174:type of actual parameter cannot be ancester of formal reference parameter type