Home | Overview | How Do I | FAQ
A termination handler is executed no matter how the __try statement block is terminated. Causes include jumping out of the __try block, a longjmp statement that transfers control out of the block, and unwinding the stack due to exception handling.
Note Visual C++ supports two forms of the setjmp and longjmp statements. The fast version bypasses termination handling but is more efficient. To use this version, include the file SETJMP.H. The other version supports termination handling as described in the previous paragraph. To use this version, include the file SETJMPEX.H. The increase in performance of the fast version depends on hardware configuration.
The operating system executes all termination handlers in the proper order before any other code can be executed, including the body of an exception handler.
When the cause for interruption is an exception, the system must first execute the filter portion of one or more exception handlers before deciding what to terminate. The order of events is: