Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function indicates whether the tryblock of a try- finallystatement terminated normally.

This function can be called only from within the finallyblock of a try- finallystatement.

Syntax

BOOL AbnormalTermination(void);

Parameters

None.

Return Value

Nonzero indicates that the tryblock of the try- finallystatement terminated abnormally. Zero indicates that the tryblock of the try- finallystatement terminated normally.

Remarks

The Excpt.h file must be explicitly included to use this function.

The tryblock terminates normally only if the execution process leaves the block sequentially after running the last statement in the block.

Statements (such as return, goto, continue, or break) that cause the process to leave the tryblock abnormally terminate the block. This occurs even if such a statement is the last statement in the tryblock.

When a tryblock terminates abnormally, it causes the system to search all stack frames to determine whether termination handlers must be called. This search can cause hundreds of instructions to run, so it is important to avoid abnormally terminating a tryblock due to a return, goto, continue, or breakstatement.

These statements do not generate an exception, even though the termination is abnormal.

To avoid abnormally terminating the try-finallyblock, the process should continue to the end of the block.

You can also run the leavestatement. The leavestatement immediately terminates the tryblock without abnormally terminating and compromising performance.

To determine whether the leavestatement is supported check your compiler documentation.

Requirements

Header excpt.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also