dll内函数声明:LONG PASCAL ReadTime(HANDLE hCom,BYTE DevNo,LPSTR pTime)
功能说明:读取设备时钟。
参数说明: hCom 为端口句柄
DevNo 为设备号(0——254),255 为广播号
pTime 返回设备时钟delphi内调用:
function ReadTime(hComm: HWND;DevNo: Byte;Var PTime: PChar): Integer;stdcall;external '201Comm.dll'; if hComm > 0 then begin
GetMem(buf,15);
iTmp := ReadTime(hComm,0,buf); //调用时候报内存错误
……
FreeMem(buf);
end;
功能说明:读取设备时钟。
参数说明: hCom 为端口句柄
DevNo 为设备号(0——254),255 为广播号
pTime 返回设备时钟delphi内调用:
function ReadTime(hComm: HWND;DevNo: Byte;Var PTime: PChar): Integer;stdcall;external '201Comm.dll'; if hComm > 0 then begin
GetMem(buf,15);
iTmp := ReadTime(hComm,0,buf); //调用时候报内存错误
……
FreeMem(buf);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货