런타임 스레드를 만들려고했지만 스레드가 이상하게 작동하고 코드에 캔버스 참조가 없습니다.스레드가 데스크탑에 쓰고 있습니다.
procedure TBruteThread.Execute;
var
j: Integer;
begin
inherited;
FreeOnTerminate:=True;
for j:=1 to StrToInt(Form1.Edit1.Text) do begin
if Terminated then break;
Form1.Label2.Caption:=IntToStr(j);
end;
Form1.Label2.Caption:='Thread is destroyed';
Self.Terminate;
end;
사람이 이상한 문제를 해결하기 위해 어떤 생각을 가지고?
어딘가에 누군가가 이걸 의도적으로하고 싶어합니다. –
VCL 및 스레드에 대한 자세한 내용은 ['Thread-safe in delphi'] (http://stackoverflow.com/q/17705197/576719)를 참조하십시오. –