![]() Inside the _finally block, the AbnormalTermination() API can be called to test whether control continued after the exception or not. When control leaves the _try block (after an exception or without an exception), the _finally block is executed. The _try and _finally keywords are used to construct a termination handler, as shown in the following example. The current handler matches and can handle the exception. This is similar to the catch block not matching an exception type in C++ and Java. Continue the handler search for the next handler. The current handler cannot handle this exception. However, the filter expression might also involve a function call. The difference is that the handler in this case is just the filter expression itself and not the _except block. This is much like the UNIX signal handling in the sense that after the signal handler finishes, the execution continues where the program was interrupted. Unlike some exception schemes, SEH supports the resumption model as well. The filter expression repaired the situation, and execution continues where the exception occurred. The filter expression should evaluate to one of the following values: The _except block is filtered by a filter expression that uses the integer exception code returned by the GetExceptionCode() API, exception information returned by the GetExceptionInformation() API, or both. ![]() In C++, the _try and _except keywords are used to guard a section of code that might result in an exception, as shown in the following example. This is stack frame-based exception handling similar to the C++ and Java exception handling mechanism. ![]() On Windows, the mechanism for handling both hardware and software exceptions is called structured exception handling (SEH). ![]() Software exceptions are initiated explicitly by applications or the operating system using the RaiseException() API. Hardware exceptions are comparable to signals such as SIGSEGV and SIGKILL on the Linux operating system. ![]() There are two kinds of exceptions: hardware exceptions and software exceptions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |