Send string data from Thread to main form
问题 In Dephi, I create a thread, like this, which will send message to main form from time to time Procedure TMyThread.SendLog(I: Integer); Var Log: array[0..255] of Char; Begin strcopy(@Log,PChar('Log: current stag is ' + IntToStr(I))); PostMessage(Form1.Handle,WM_UPDATEDATA,Integer(PChar(@Log)),0); End; procedure TMyThread.Execute; var I: Integer; begin for I := 0 to 1024 * 65536 do begin if (I mod 65536) == 0 then begin SendLog(I); End; End; end; where WM_UPDATEDATA is a custom message,