473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Exception handling at the GUI boundary


a) My cMyMainForm throws an unhandled exception (in my
case a third party component throws a SEHException when
hovering the mouse pointer over it). I want to display my
own dialog box instead of .NET's and take the system down
gracefully.

b) I've tried the UnhandledException event but I cant
find any functionality that allows me to suppress the
exception dialog, in fact the exception dialog is
displayed BEFORE the event is fired.

c) I could always try/catch the Application.Run method in
my Main method but when I'm inside the catch my form
object is long gone so I cant show ANY dialog.

Any suggestions on how to accomplish a)?
Nov 15 '05 #1
2 1714
"Bevo" wrote:

a) My cMyMainForm throws an unhandled exception (in my
case a third party component throws a SEHException when
hovering the mouse pointer over it). I want to display my
own dialog box instead of .NET's and take the system down
gracefully. b) I've tried the UnhandledException event but I cant
find any functionality that allows me to suppress the
exception dialog, in fact the exception dialog is
displayed BEFORE the event is fired.

c) I could always try/catch the Application.Run method in
my Main method but when I'm inside the catch my form
object is long gone so I cant show ANY dialog.

Any suggestions on how to accomplish a)?/


You need to install event handlers for both of these events:

Application.ThreadException -- solves a)
AppDomain.UnhandledException -- for non-CLS-Compliant exceptions

Cheers,

--
Joerg Jooss
jo*********@gmx.net
Nov 15 '05 #2
"Bevo" wrote:

a) My cMyMainForm throws an unhandled exception (in my
case a third party component throws a SEHException when
hovering the mouse pointer over it). I want to display my
own dialog box instead of .NET's and take the system down
gracefully. b) I've tried the UnhandledException event but I cant
find any functionality that allows me to suppress the
exception dialog, in fact the exception dialog is
displayed BEFORE the event is fired.

c) I could always try/catch the Application.Run method in
my Main method but when I'm inside the catch my form
object is long gone so I cant show ANY dialog.

Any suggestions on how to accomplish a)?/


You need to install event handlers for both of these events:

Application.ThreadException -- solves a)
AppDomain.UnhandledException -- for non-CLS-Compliant exceptions

Cheers,

--
Joerg Jooss
jo*********@gmx.net
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Abelardo Vacca | last post by:
Hello, I am currently in the process of switching our application to a N-Tier model with .NET. One of the aspects we want ot get right from the start not to worry about it after is the...
7
by: Dan Bass | last post by:
In a somewhat complex application, I've developed plug-in architecture and am having a problem as to when to catch general exceptions for logging purposes. In each plug-in class library, for...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
1
by: Abelardo Vacca | last post by:
Hello, I am currently in the process of switching our application to a N-Tier model with .NET. One of the aspects we want ot get right from the start not to worry about it after is the...
12
by: Subhransu Sekhar Sahoo | last post by:
Hi All, I have a doubt in the implementation of C++ try catch exception handling procedure. Whenever there is a through, the execution has to go to the point of catch. Now, if the catch block...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.