?
Solved

handling unknown exceptions

Posted on 2000-02-09
8
Medium Priority
?
372 Views
Last Modified: 2010-04-04
my prog raises an unknown exception and then become unstable any advice ?

I have the following parts in it:

-a thread that checks a SQL table every second
- serial port component ( from varian software)
- stored procedure that update/check tha data
-two timers : one for sending acknowledgement , another for checking recieved data END.
 

Note:
 it may takes several times before raising th exception
.

ReGaRdS
Anas
0
Comment
Question by:anas_madani
8 Comments
 
LVL 3

Expert Comment

by:ckaneta
ID: 2505286
put the code that causes the exception in a try..except block.
you can do
try
 some stuff
except do
 some stuff on any exception


0
 

Author Comment

by:anas_madani
ID: 2505323
appricheate your guick comment.

I don't even know the part that causes the exception, I only got a message says
: Unknown exception at memory address :xxxxxx




AnAs
0
 
LVL 3

Expert Comment

by:ckaneta
ID: 2505477
okay from there I'd set breakpoints before you check the table, and also
before you call the stored procedure to
see if we can determine where the exception gets raised.  once you figure that out, let us know and we'll see if we can't be of more help

luck
carl
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
LVL 10

Expert Comment

by:ptmcomp
ID: 2505519
I agree with ckanteta. Try this:

procedure TMyThread.Execute;
begin
  try
//    somestuff here
  except
    on e: Exception do
    begin
      e.Message:=e.Message+' raised in TMyThread';
      raise;
    end;
  end;
end;

procedure TAnyForm.OnTimer(Sender: TObject);
begin
  try
//    somestuff here
  except
    on e: Exception do
    begin
      e.Message:=e.Message+' raised in TAnyForm.OnTimer';
      raise;
    end;
  end;
end;

And so on...


Reagards, ptm.
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2505530

Have you tried using ApplicationEvents' OnException? The sender parameter should tell you where the Exception is being raised. The Exception paramter of course will tell what the exact exception is and GetLastError should give you more background into that error.


Good luck!!
 
0
 

Author Comment

by:anas_madani
ID: 2506029
I've tried the Application On exception event and I still having the message:


The Exception unknown software exception [0x0eedfade] occurred in the application at location 0x6591d445 !


It hurts .


AnAs
0
 

Expert Comment

by:derover
ID: 2507010
to pinpoint strange exceptions, put this in EVERY procedure/function (or in every proc where you expect the error to be in) :



var
  errstring:string;
Begin
  errstring:='';
  try
    errstring:='before something something';
    //one line of orginal code <HERE>
    errstring:='some comment';
    //on line of orginal code <HERE>
    errstring:='some other comment';
    //on line of orginal code <HERE>
    //etc, etc
  except
   on e:exception do
      showmessage(e.message+': '+ErrString);
  end;
end;


Hope this helps to pinpoint the prob. If the problem is just not catched, i suggest you download MemProof (http://www.listsoft.ru/eng/programs/pr1520.htm , forgot the orginal site's url) . Maybe with that very cool program you can discover you error(s).

Good luck :)


-Rover
0
 

Accepted Solution

by:
Freaky earned 300 total points
ID: 2552016

I have made some practise with serial comm and threads and so on ..

My experience is that the only way to make the app stable is to NOT use timers.

Use loops and let windows handle the timeouts ..

(I guess that your app calls a still running function again (perhaps from the component you use) and causes the exception - you probably won't be able to locate it by tracing though 'cause you can't stop the comm-timeouts)

Greets

 Sascha
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…

589 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