Yewsia
asked on
"raised exception class EThread" error box
Hi guys,
I am doing a software on delphi, and I got this error message when I close my program.
error message:
project TTEST_1.exe raised exception class EThread
with message 'Thread Error: The handle is invalide(6)'.
Process stopped. Use Step or Run to continue.
I suspect that the following program code below is making the trouble.
program code:
procedure Ttest.FormShow(Sender: TObject);
begin
try
CommunicationPort.Open;
except
on e:ECommException do begin
Application.ShowException( e );
close;
end;
end;
end; // end of FormShow procedure.
I exit my program using the procedure I write below.
my exit program procedure:
procedure TXMKRAW.Close_Program();
begin
CommunicationPort.Close;
close;
end;
I am doing a software on delphi, and I got this error message when I close my program.
error message:
project TTEST_1.exe raised exception class EThread
with message 'Thread Error: The handle is invalide(6)'.
Process stopped. Use Step or Run to continue.
I suspect that the following program code below is making the trouble.
program code:
procedure Ttest.FormShow(Sender: TObject);
begin
try
CommunicationPort.Open;
except
on e:ECommException do begin
Application.ShowException(
close;
end;
end;
end; // end of FormShow procedure.
I exit my program using the procedure I write below.
my exit program procedure:
procedure TXMKRAW.Close_Program();
begin
CommunicationPort.Close;
close;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
btw, you can try running your exe file with your required database and ini file in a separate folder.
something like:
procedure TXMKRAW.Close_Program();
begin
if CommunicationPort.Active then // or .Connected
CommunicationPort.Close;
close;
end;