title: Application.OnException fails to handle all the exception - Delphi
body: <p>I'm using Delphi 7 and in an attempt to handle all the possible exceptions being thrown during the run of the program. I used Application.OnException := HandlerProcedure; to handle exceptions but when exception occurs, HandlerProcedure never gets called. In order to assure if it really works, I raised exception after I assigned Application.OnException as below:</p>
  
  <pre><code>Application.OnException := HandlerProcedure;
  raise Exception.Create('Exception');
  </code></pre>
  
  <p>and defined HandlerProcedure as:</p>
  
  <pre><code>procedure TFormMain.HandlerProcedure(Sender: TObject; E: Exception);
  begin
      ShowMessage('Exception.');      
      Exit;
  end;
  </code></pre>
  
  <p>But HandlerProcedure never gets called. How can I make it handle all the exceptions?</p>