{
OnException, ShowException, Terminate example
In addition to displaying the exception message, which happens by default, the following code shuts down the application when an exception is not caught and handled.
} 
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  Application->OnException = AppException;
}

void __fastcall TForm1::AppException(TObject *Sender, SysUtils::Exception *E)
{
  Application->ShowException(E);
  Application->Terminate();
} 
