; 如果通信不成功,即没有收到CC,那么程序都关不了,怎么解决啊
, pDataToWrite[1]:=chr(byte($D1));
LDate:=1;
Comm1.Inx_XonXoffFlow:=false;
Comm1.Outx_XonXoffFlow:=false;
Comm1.WriteCommData(@(pDataToWrite),LDate);
while ((not (sRece1='CC')) do
begin
Application.ProcessMessages;
end; if sRece1<>'CC' then
begin
Application.MessageBox('握手失败!','提示',MB_OK+MB_ICONINFORMATION);
End
, pDataToWrite[1]:=chr(byte($D1));
LDate:=1;
Comm1.Inx_XonXoffFlow:=false;
Comm1.Outx_XonXoffFlow:=false;
Comm1.WriteCommData(@(pDataToWrite),LDate);
while ((not (sRece1='CC')) do
begin
Application.ProcessMessages;
end; if sRece1<>'CC' then
begin
Application.MessageBox('握手失败!','提示',MB_OK+MB_ICONINFORMATION);
End
如:
while ((not (sRece1='CC') and isCancel) do...如 waitforsingleobject()...