AbnormalTermination (Windows CE 5.0)
This function indicates whether the try block of a try-finally statement terminated normally.
This function can be called only from within the finally block of a try-finally statement.
BOOLAbnormalTermination(void);
Parameters
None.
Return Values
Nonzero indicates that the try block of the try-finally statement terminated abnormally.
Zero indicates that the try block of the try-finally statement terminated normally.
Remarks
The Excpt.h file must be explicitly included to use this function.
The try block terminates normally only if the execution process leaves the block sequentially after executing the last statement in the block.
Statements (such as return, goto, continue, or break) that cause the execution process to leave the try block will abnormally terminate the block. This occurs even if such a statement is the last statement in the try block.
When a try block abnormally terminates, 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 execute, so it is important to avoid abnormally terminating a try block due to a return, goto, continue, or break statement.
These statements do not generate an exception even though the termination is abnormal.
To avoid abnormally terminating the try-finally block, the execution process should continue to the end of the block.
You can also execute the leave statement. The leave statement allows you to immediately terminate the try block without abnormally terminating and compromising performance.
To determine if the leave statement is supported check your compiler documentation.
Requirements
OS Versions: Windows CE 1.0 and later.
Header: Excpt.h.
Link Library: Coredll.lib.
See Also
Send Feedback on this topic to the authors