Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

"raised exception class EThread" error box

Posted on 2003-03-19
3
Medium Priority
?
314 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
  • 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

580 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