30-10-2019, Saat: 13:42
Merhaba;
Firemonkeyde TThread kullanmak istiyorum. Programı yormadan arka planda çalışacak web sitelerden veri çekeceğim.
Fakat daha test aşamasında aşağıdaki hata mesajını aldım. Bu sorun neden kaynaklanıyor olabilir?
First chance exception at $76274592. Exception class Exception with message 'Messages must be shown in the main UI thread.
Firemonkeyde TThread kullanmak istiyorum. Programı yormadan arka planda çalışacak web sitelerden veri çekeceğim.
Fakat daha test aşamasında aşağıdaki hata mesajını aldım. Bu sorun neden kaynaklanıyor olabilir?
First chance exception at $76274592. Exception class Exception with message 'Messages must be shown in the main UI thread.
procedure TimerAjansKontrolTimer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
AjansKontrol = class(TThread)
protected
procedure Execute; override; // ctrl + shift + c'ye bas
end;
var
Form1: TForm1;
{ AjansKontrol }
procedure TForm1.TimerAjansKontrolTimer(Sender: TObject);
begin
with AjansKontrol.Create do
FreeOnTerminate := True // İşlem bitince bellekten sil
end;
procedure AjansKontrol.Execute;
begin
inherited;
try
ShowMessage('');
finally
end;
end;