var
mByteAry: array of byte;
begin
setlenth(mByteAry,7);
mByteAry[0]:=$02;
mByteAry[1]:=$03;
mByteAry[2]:=$00;
mByteAry[3]:=$0a;
mByteAry[4]:=$00;
mByteAry[5]:=$01;
mByteAry[6]:=$a4;
mByteAry[7]:=$3b;
加上chr以后呢?
MSCOMM的Output 是OLEVariant 类型
Delphi的帮助中写道
When you assign a Variant that contains custom data (such as a Delphi string, or a one of the new custom variant types) to an OleVariant, the runtime library tries to convert the Variant into one of the OleVariant standard data types (such as a Delphi string converts to an OLE BSTR string). For example, if a variant containing an AnsiString is assigned to an OleVariant, the AnsiString becomes a WideString.