title: MessageBox "Abnormal program termination" keeps my application running
body: <p>...kind of. As illustrated by this extremely simplistic example,</p>
  
  <p><img src="https://i.stack.imgur.com/ymqSr.png" alt="enter image description here"></p>
  
  <p>very rarely (only once reported so far), it happens that one of my applications crashes this way. I want to terminate it as I normally do when an unspecific exception occurs. My strategy is to (low-level) log the problem, then terminate. The application is part of a subsystem and I want to (re)start it, if any problem is detected. It's built with C++-Builder 6 and runs on Windows (XP...7, also 8). I learned that an <code>abort()</code> most probably caused the error message. The application has a GUI, that's why a message box is shown instead of just making an (unblocking) output to <code>stderr</code>.</p>
  
  <p>And as long as the message box isn't accepted by a user, my application <strong>keeps obviously running</strong>, for example it handles timers (the lifebeats in the above example increase) or inter-process messages, fully unaware about the problem.</p>
  
  <p>After reading some answers to <a href="https://stackoverflow.com/a/8482142/2932052">What is the easiest way to make a C++ program crash?</a> and <a href="https://stackoverflow.com/a/20213552/2932052">Difference between raise(SIGABRT) and abort() methods</a>, I tried the following </p>
  
  <pre><code>void mySignalHandler(int sig)
  {
      // low-level error reporting here
      exit(-1);
  }
  
  void __fastcall TForm1::FormCreate(TObject *Sender)
  {
      signal(SIGABRT, mySignalHandler);
      // some more initialisation here
  }
  </code></pre>
  
  <p>which lets my <strong>application terminate</strong> properly also if <code>abort()</code> or <code>raise(SIGABRT)</code> is called. (I also wish to prevent Windows from "searching for a solution of the problem".) </p>
  
  <p>Is this (registering a signal handler for abort and calling exit there) reliable from your point of view? ...or at least something one can build upon?</p>