473,734 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1463
> 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***@vk arlsen.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
8492
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential problem. The program may crash unexpectedly while writing to the file. If so, my program should detect this during startup, and then (during startup) probably delete the data added to the file and redo the writing operation.
10
3304
by: Paul Miller | last post by:
I'm not sure if this is a python bug or a bug in an associated library, and I'm not even sure how to correctly report it, but here is Anytime python is accepting keyboard input, whether it's with raw_input, or sitting on the command line waiting for the user to type code, you can crash python by holding ctrl+shift and then pressing enter. This is on a RedHat 9.0 system running on an Athlon 600. Basically everything about the system is...
1
2555
by: Mark Carter | last post by:
I use Office 2000, and I have recently upgraded to python 2.3 and win32all-155.exe The following code worked in python 2.2: xlApp = Dispatch("Excel.Application") xlApp.Visible = 1 xlApp.Workbooks.Add() xlApp.ActiveWorkbook.SaveAs(sys.path + '\\temp.xls') wb = xlApp.Workbooks("temp.xls")
0
1417
by: Adam | last post by:
I have an application which interacts with a webserver over https using client certificates. Due to a bug in openssl 0.9.6, I upgraded to 0.9.7 and rebuilt python. Now, when I access the page python is crashing with with a "bus error" and coring. Any insite as to what I need to do to fix this? The gdb output is below.
0
1438
by: J Skeggs | last post by:
Hi, Please can someone help me! I have an excel macro which runs a macro in a microsoft access database using the following code: '******************************************** '* This part of the routine runs another routine within * '* MS Access to export data to MS Excel *
1
1106
by: EK | last post by:
I have an application that executes a lengthy search (5-10 sec) against a SQL server. Everything runs fine when only one user executes the search but when 2 or more users searching at once the application crash. The query returns a valid dataset, but when the application trying to access data stored in the session object it’s like the object is reset and no data is variable. Its working quit well with only one user or when the users not...
5
1229
by: Rarlfth Nadar | last post by:
Create a new solution, add a class... Public Class Class1 Public Sub New() .New() '<----- This line will blow up the IDE
2
2017
by: Anbeyon | last post by:
Hi Sorry for cross posting but didn't see this group earlier... I'm hoping someone might be able to point me in the right direction. I have a number of applications written in vb6. Two of the apps are still in development and so I have sat down today to continue working on them but have discovered I have a real big problem.
39
5865
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
0
8948
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9246
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9186
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8190
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6035
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.