Stick receive procedures (control of the serial port using SPCOMM), using the method of the message to receive
Void __fastcall TForm1: : OnShowProgress (TMessage & amp; Msg)
{
If (nbyte> 0)
{
AnsiString S, T;
for(int i=0; I
T=IntToHex (Buf [I], 2);
If (T.L ength () & gt; 2) T=T.S ubString (7, 2);
S=S + T + "";
}
Memo2 - & gt; Lines - & gt; Add (S);
}
}
Void __fastcall TForm1: : Comm1ReceiveData (TObject * Sender, Pointer Buffer,
WORD BufferLength)
{
Nbyte=BufferLength;
Move (Buffer, Buf, BufferLength);
PostMessage (Handle, WM_SHOW_PROGRESS, NULL, NULL);
}
CodePudding user response:
Branch to \ r \ n you got in your data symbols is done, you yourself to join in a S \ r \ nCodePudding user response:
In the Memo space so write:Memo2 - & gt; Lines - & gt; Add (S + "\ r \ n");