?
Solved

catching exceptions generated by ActiveX control I've drawn on screen

Posted on 1998-08-10
5
Medium Priority
?
413 Views
Last Modified: 2010-04-04
I have an activeX control I put on my main form (drawn on in delphi IDE).  This happens to be the RealPlayer activex control, but that shouldn't be important to the question.   Occasionally, the control generates an exception.  I would like to use a Try/Except block to catch and handle or ignore the error.  The problem is, since it isn't really code I'm executing that causes it, but something asynchronous happening in the control that causes it, I can't figure out where the Try/Except would go to catch this exception.  
0
Comment
Question by:kdw
[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
  • 3
5 Comments
 
LVL 3

Expert Comment

by:vladika
ID: 1361855
Try to use Application.OnException event
0
 

Author Comment

by:kdw
ID: 1361856
If I put something there, that basically does nothing but write to a log file, will the user still see the exception message, and will the program still exit after the exception?
0
 
LVL 3

Expert Comment

by:vladika
ID: 1361857
How wrote in the source

  if ExceptObject is Exception then
  begin
    if not (ExceptObject is EAbort) then
      if Assigned(FOnException) then
        FOnException(Sender, Exception(ExceptObject))
      else
        ShowException(Exception(ExceptObject));
  end else
    SysUtils.ShowException(ExceptObject, ExceptAddr);

So, if you assign OnException handler then message will not appear.
If you want show message
you can call Application.ShowException in the OnException
event handler.

0
 
LVL 3

Expert Comment

by:vladika
ID: 1361858
BTW, What do you mean "will the program still exit after the exception?"
Are program terminate after exception?
If yes, what kind of exception ActiveX generates?

0
 

Accepted Solution

by:
khenr29j earned 800 total points
ID: 1361859
The Realplayer control does not work well with the Delphi IDE.  I have confirmed this with theur tech support.  I recommend creating the controls at runtime to avoid problems. I had to do some stuff with Real Audio a couple of months ago and their activeX control is a real barebones component that dosn't expose much of the underlying API.  I ended up writing a Delphi implementation of it. It still has problems running in the IDE but at least I have the functionality I want. Contact my by e-mail at khenr29j@@paprika.mwc.edu (remove second @ sign) if you are interested in the Delphi translation.

To answer your question about AVs. To catch the error in the IDE requires wrapping the offending code in a Try ... Except clause.  As you noted, it is happening in the Real Audio code and there is nothing you can do to catch these errors as they happen behind the scenes without your code calling it.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

771 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