Crash and quit

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.
 
?

=?iso-8859-1?Q?Lasse=20V=e5gs=e6ther=20Karlsen?=

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.
 
R

Rene

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.
 
O

Otis Mukinfus

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
 
R

Rene

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top