唉! 我以为给你那个函数你会修改,原来不会啊! 再帮你写一个PChar版本吧
function TReceiveDataBase.ToHexString(HexBuf: PChar;
BufSize: Integer): String;
var
iByte: Byte;
iStart: Integer;
begin
iStart := 0;
Result := '';
while iStart < BufSize do
begin
iByte := Byte(HexBuf[iStart]);
if Result <> '' then Result := Result + IntToHex(iByte, 2)
else Result := IntToHex(iByte, 2);
iStart := iStart + 1;
end;
end;