title: in the handler of SetUnhandledExceptionFilter how to print a stacktrace?
body: <p>When unhandled exception occured i want to print a stacktrace instead of just terminating. I've tried to do that using <code>SetUnhandledExceptionFilter</code>:</p>
  
  <pre><code>SetUnhandledExceptionFilter(UnhandledException);
      ...
  LONG WINAPI UnhandledException(LPEXCEPTION_POINTERS exceptionInfo)  
  {  
      printf("An exception occurred which wasn't handled!\nCode: 0x%08X\nAddress: 0x%08X",   
          exceptionInfo-&gt;ExceptionRecord-&gt;ExceptionCode,  
          exceptionInfo-&gt;ExceptionRecord-&gt;ExceptionAddress);
      return EXCEPTION_EXECUTE_HANDLER;  
  }
  </code></pre>
  
  <p>This code, i've found, works fine. However there are no addition information because <code>ExceptionCode</code> and <code>ExceptionAddress</code> are printed in system "Event Viewer" anyway.
  If it is possible to print a full stack trace so I can determine the exact point where exception occured?</p>
  
  <p>I've found this code <a href="https://code.google.com/p/m0d-s0beit-sa/source/browse/src/main.cpp?r=9ceb4fec21d647b169c72851d7882bef2b9c5a8a" rel="nofollow">https://code.google.com/p/m0d-s0beit-sa/source/browse/src/main.cpp?r=9ceb4fec21d647b169c72851d7882bef2b9c5a8a</a> It partly solves my problem. Only method where exception occured is printed. But type of exception and line number is not printed.</p>