Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1998-08-10
5
Medium Priority
?
414 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

636 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