604
社区成员
发帖
与我相关
我的任务
分享
void __fastcall MSComm1Comm(TObject *Sender)
{
String temp;
byte buff[100];
int ByteNum;
OleVariant RxBuff;
if(MSComm1->CommEvent==comEvReceive)
{
if(MSComm1->InBufferCount>0)
{
RxBuff = MSComm1->Input;
ByteNum = RxBuff.ArrayHighBound();
for(int i=0;i<=ByteNum;i++)
buff[i]=RxBuff.GetElement(i);
temp=IntToHex(buff[0],2);
Memo1->Text+=temp;
}
}
}