471,354 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Crash and quit

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.


Jan 30 '06 #1
4 1338
> 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.

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Jan 30 '06 #2
> Try wrapping the code in the main application method in a try/catch
clause.


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.
Jan 30 '06 #3
On Mon, 30 Jan 2006 02:04:39 -0600, "Rene" <a@b.c> wrote:
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
Jan 30 '06 #4
> 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.
Jan 30 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

48 posts views Thread by Joseph | last post: by
10 posts views Thread by Paul Miller | last post: by
1 post views Thread by Mark Carter | last post: by
reply views Thread by Adam | last post: by
reply views Thread by J Skeggs | last post: by
2 posts views Thread by Anbeyon | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.