to xusong168
我的代码是如下,可有问题
var
vTmp: variant;
ovTmp: oleVariant;
i: integer;
iReceived: integer;
bTmp: byte;
Buff:array[0..5000] of byte;
begin
case MSRequest.CommEvent of
comEvReceive: //2 收到Rthreshold个字符。该事件将持续产生
begin //直到用input属性从接收缓冲区中删除数据
iReceived := MSRequest.InputLen; //mscomm1.InBufferCount;//
ovTmp := MSRequest.Input;
vTmp := VarArraycreate([0, iReceived], varbyte);
vTmp := ovTmp;
for i := 0 to iReceived - 1 do //接收返回信息,存入buff中
begin
bTmp := vTmp;
buff := btmp;
end;
end;
end;
end;