Paul,

It seems the Forms runtime code adds a ThreadExceptionHandler
to the application. Instead of using an UnhandledExceptionHandler,
try using a ThreadExceptionHandler.

Application.ThreadException +=
   new ThreadExceptionEventHandler(MyExceptionHandler);

Hope this helps.

Pradeep
http://www.tapadiya.net/pradeep

----- Original Message -----
From: "Paul Stevens" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 4:28 AM
Subject: Re: [DOTNET] Handling Unhandled Exceptions


> I am really doing something wrong here, Two scenarios, in a Forms Sub New
I
> Throw an exception, my unhandled exception event handler catches this and
> everything is just fine, now I take the same exception and throw it in a
> buttons Click event and nothing nada Zip, the exception is reported and
the
> app gives you the option to continue or quit just like in the Sub new, yet
> if I choose any option it does nothing NOT like in the case of the sub new
>
> -----Original Message-----
> From: Patrick Steele [mailto:[EMAIL PROTECTED]]
> Sent: 10 June 2002 08:24 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Handling Unhandled Exceptions
>
> Are you sure its getting ignored?  When I try it, I get the standard
> dialog about the CLR catching an unhandled exception -- press OK to
> teminate or CANCEL to debug.  If I press "OK", my exception handler
> runs.
>
> I believe you're getting the dialog popped up since you have the .NET
> SDK installed.  Try it on a machine with only the runtime.
>
> ---
> Patrick Steele ([EMAIL PROTECTED])
> Lead Software Architect
> Image Process Design
>
>
>
> -----Original Message-----
> From: Paul Stevens [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 10, 2002 4:59 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Handling Unhandled Exceptions
>
>
> Aaaaargh OK I Got this Working Pretty Well, Both by Using the
> Thread.Unhandled Exception and try catch around the application.Run, but
> there is some weird behaviour.
>
> When I am running it in VS everything Works Great, Compile it run the
> app
> from the command line and the handler gets ignored ?????????????????
>
> -----Original Message-----
> From: Patrick Steele [mailto:[EMAIL PROTECTED]]
> Sent: 06 June 2002 10:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Handling Unhandled Exceptions
>
> See this thread (make sure you read to the end):
>
> http://discuss.develop.com/archives/wa.exe?A2=ind0109B&L=DOTNET&P=52210
>
> ---
> Patrick Steele ([EMAIL PROTECTED])
> Lead Software Architect
> Image Process Design
>
>
>
> -----Original Message-----
> From: Paul Stevens [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 5:42 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Handling Unhandled Exceptions
>
>
> Cool Thanks, I can't find any Example of doing this, or at least the
> ones I
> find don't work, any Examples that you know of
>
> -----Original Message-----
> From: Nick Wienholt [mailto:[EMAIL PROTECTED]]
> Sent: 04 June 2002 10:01 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] Handling Unhandled Exceptions
>
> Try the AppDomain.UnhandledException Event
>
> Nick
>
> ----- Original Message -----
> From: "Paul Stevens" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 04, 2002 5:20 PM
> Subject: [DOTNET] Handling Unhandled Exceptions
>
>
> > Is there a way to capture all unhandled exceptions in my code ie a
> > centralized exception handling function for all exceptions I did not
> handle
> > specifically ?
> >
> >
> >
> > Paul Stevens
> > Senior Developer
> > Resolution Technology Group
> > Cellular: * +27 (0) 82 413 3171
> > Phone:   *    +27 (0) 12 665 4620
> > Fax:        *    +27 (0) 12 665 4619
> > Mail:       *    [EMAIL PROTECTED]
> >
> >
> >
> > Privileged/Confidential information may be contained in this message.
> If
> you
> > are not the addressee indicated in this message (or responsible for
> delivery
> > of the message to such person), you may not copy or deliver this
> message
> to
> > anyone. In such case, you should destroy this message, and notify us
> > immediately. If you or your employer does not consent to Internet
> email
> > messages of this kind, please advise us immediately. Opinions,
> conclusions
> > and other information expressed in this message are not given or
> endorsed
> by
> > our firm or employer unless otherwise indicated by an authorized
> > representative independent of this message.
> >
> > You can read messages from the DOTNET archive, unsubscribe from
> DOTNET, or
> > subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET,
> or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET,
> or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET,
> or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET,
> or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to