?
Solved

"raised exception class EThread" error box

Posted on 2003-03-19
3
Medium Priority
?
288 Views
Last Modified: 2010-04-04
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;
0
Comment
Question by:Yewsia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Expert Comment

by:mocarts
ID: 8172527
before calling CommunicationPort.Close check wheteher it is opened.
something like:

procedure TXMKRAW.Close_Program();
begin
  if CommunicationPort.Active then // or .Connected
   CommunicationPort.Close;
  close;
end;
0
 

Accepted Solution

by:
WowPiangEh earned 90 total points
ID: 8179088
this thing might works, try this.

1) check that the files you add to the projects is in the directory of your project.  
2) if you notice that there is some missing file that is supposed to be linked to the project, find and copy the file and put it into the project directory, use "add to project" or Shift+F11

3) check whatever port or variable which you have opened and not closed yet.
0
 

Expert Comment

by:WowPiangEh
ID: 8207503
btw, you can try running your exe file with your required database and ini file in a separate folder.  
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question