Crash and quit

  • Thread starter Thread starter Rene
  • Start date Start date
R

Rene

I noticed that when a .Net application crashes you get a message box
indicating that an unhandled exception has occurred and it gives you the
option to Continue or Quit.



What I would like to do is to disable the Continue button so the application
is forced to end. I need this behavior because if my app crashes like that
it means that something unexpected happen and the state of my objects
(variable values) may be undetermined and the app should not continue
because if it does it will have unpredictable behavior.



Is there an easy way to do this or do I have to catch all unhandled
exceptions and end the program manually by code?



Thanks.
 
I noticed that when a .Net application crashes you get a message box
indicating that an unhandled exception has occurred and it gives you
the option to Continue or Quit.

What I would like to do is to disable the Continue button so the
application is forced to end. I need this behavior because if my app
crashes like that it means that something unexpected happen and the
state of my objects (variable values) may be undetermined and the app
should not continue because if it does it will have unpredictable
behavior.

Is there an easy way to do this or do I have to catch all unhandled
exceptions and end the program manually by code?

Thanks.

Try wrapping the code in the main application method in a try/catch clause.
 
Try wrapping the code in the main application method in a try/catch

Yep, that's what I am doing right now I was just wondering if there is
another solution to hard coding the end of the app when crashing.
 
I noticed that when a .Net application crashes you get a message box
indicating that an unhandled exception has occurred and it gives you the
option to Continue or Quit.
It seems to me that you will only see it that way if you are in the
IDE and in debug mode. Your compiled release version should not do
that. It should only show the OK button. Please correct me if I'm
wrong.

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
 
It seems to me that you will only see it that way if you are in the
IDE and in debug mode. Your compiled release version should not do
that. It should only show the OK button. Please correct me if I'm
wrong.

No, it shows both buttons no matter what, at least on my computer.
 
Back
Top