I had similar issues when I upgraded from D5 to D7.  Basically D5 
allowed you access to the thread properties even after it had terminated 
and freed itself.  The AThread.Destroy is probably failing since the 
thread has already been freed automatically.

Ross.

----- Original Message ----- 
From: "Arno Garrels" <[EMAIL PROTECTED]>
To: "Borland's Delphi Discussion List" <[email protected]>
Sent: Monday, February 27, 2006 8:27 AM
Subject: TThread mystery since D6/D7


Hello,

When I run the code below in D7 as well as BDS2006 I get an EThread
exception with message "Invalid handle(6)". In D5 there was no problem
with the same code. Has anybody any idea why that happens?

Thanks,

Arno Garrels

var
AThread : TThread;

procedure TForm1.FormCreate(Sender: TObject);
begin
    AThread := TThread.Create(True);
    AThread.FreeOnTerminate := True;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
    AThread.Destroy;
end; 

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to