PC Review


Reply
Thread Tools Rate Thread

Unhandled Exceptions

 
 
Christoph Basedau
Guest
Posts: n/a
 
      1st Jun 2010
Hi

in order to give the user a last info before his app dies, due to
uncaught exceptions
we implemented the code from msdn (<URL:http://msdn.microsoft.com/en-
us/library/ms223898.aspx>) that utilizes

Application.SetUnhandled,
Application.ThreadException,
AppDomain.CurrentDomain.UnhandledException.

As expected unhandled non-UI exceptions no go through our method
'OnUnhandledException'
and a last grave note is displayed to our user.
Nonetheless after 'OnUnhandledException' is out of scope, the runtime
still
crashes with sth like "windows encountered a problem with app.exe,
app.exe is shutdown".
This msg also occurs when unhandled exceptions are not directed to any
handler.

Is there a way to suppress this OS-crash message?

Thx
Christoph
 
Reply With Quote
 
 
 
 
Peter Duniho
Guest
Posts: n/a
 
      1st Jun 2010
Christoph Basedau wrote:
> Hi
>
> in order to give the user a last info before his app dies, due to
> uncaught exceptions
> we implemented the code from msdn (<URL:http://msdn.microsoft.com/en-
> us/library/ms223898.aspx>) that utilizes
>
> Application.SetUnhandled,
> Application.ThreadException,
> AppDomain.CurrentDomain.UnhandledException.
>
> As expected unhandled non-UI exceptions no go through our method
> 'OnUnhandledException'
> and a last grave note is displayed to our user.
> Nonetheless after 'OnUnhandledException' is out of scope, the runtime
> still
> crashes with sth like "windows encountered a problem with app.exe,
> app.exe is shutdown".
> This msg also occurs when unhandled exceptions are not directed to any
> handler.
>
> Is there a way to suppress this OS-crash message?


Yes. Catch the exception that is currently unhandled.

The UnhandledException and ThreadException events don't allow you to
handle the exception. They just allow you to learn when an exception
has been unhandled. But, if the handlers for those events are called,
then it means you still have an unhandled exception. And if you still
have an unhandled exception, then Windows is still going to see the
program crash.

Pete
 
Reply With Quote
 
 
 
 
Christoph Basedau
Guest
Posts: n/a
 
      2nd Jun 2010
On 1 Jun., 17:45, Peter Duniho <(E-Mail Removed)>
wrote:

> Christoph Basedau wrote:
> > [Handling uncaught exceptions] using
> > Application.SetUnhandledExceptionMode,
> > Application.ThreadException,
> > AppDomain.CurrentDomain.UnhandledException.
> >
> > still raises "windows OS-crash message"

>
> > Is there a way to suppress this OS-crash message?

>
> Yes. Catch the exception that is currently unhandled.
>
> The UnhandledException and ThreadException events don't allow you to
> handle the exception. They just allow you to learn when an exception
> has been unhandled. But, if the handlers for those events are called,
> then it means you still have an unhandled exception. And if you still
> have an unhandled exception, then Windows is still going to see the
> program crash.



Hi Pete,
thx for your reply
Sounds somehow reasonable to me these eventhandlers don't
automagically handle any exception.


Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
an unhandled win32 exception was unhandled occurred in inetinfo.exe Warren Tang Microsoft ASP .NET 1 23rd Sep 2008 04:01 PM
Capturing unhandled exceptions Alex Glass Microsoft Dot NET Framework 3 8th Feb 2005 07:11 PM
unhandled exceptions =?Utf-8?B?ZnVsbG9mcXVlc3Rpb25z?= Windows XP Help 0 18th May 2004 01:41 AM
Catching ALL Unhandled Exceptions James Hancock Microsoft Dot NET Framework 5 13th Jan 2004 05:38 PM
error codes and unhandled exceptions JOAN D. STROM Windows XP Basics 1 23rd Aug 2003 12:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:28 AM.