Crash and quit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rene

    #1

    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.






  • Lasse Vågsæther Karlsen

    #2
    Re: Crash and quit

    > I noticed that when a .Net application crashes you get a message box[color=blue]
    > 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.
    >[/color]

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

    --
    Lasse Vågsæther Karlsen

    mailto:lasse@vk arlsen.no
    PGP KeyID: 0x2A42A1C2


    Comment

    • Rene

      #3
      Re: Crash and quit

      > Try wrapping the code in the main application method in a try/catch[color=blue]
      > clause.[/color]

      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.


      Comment

      • Otis Mukinfus

        #4
        Re: Crash and quit

        On Mon, 30 Jan 2006 02:04:39 -0600, "Rene" <a@b.c> wrote:
        [color=blue]
        >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.
        >
        >
        >[/color]
        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


        Comment

        • Rene

          #5
          Re: Crash and quit

          > It seems to me that you will only see it that way if you are in the[color=blue]
          > 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.[/color]

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


          Comment

          Working...