November 2007
Intermediate to advanced
848 pages
27h 15m
English
Let’s take a closer look at the exception filter to see how it evaluates to one of the three exception identifiers defined in Excpt.h. In Funcmeister2 the EXCEPTION_EXECUTE_HANDLER identifier is hard-coded directly into the filter for simplicity’s sake, but you can make the filter call a function that will determine which of the three identifiers should be returned. Here’s another code example:
TCHAR g_szBuffer[100]; void FunclinRoosevelt1() { int x = 0; TCHAR *pchBuffer = NULL; __try { *pchBuffer = TEXT('J'); x = 5 / x; } __except (OilFilter1(&pchBuffer)) { MessageBox(NULL, TEXT("An exception occurred"), NULL, MB_OK); } MessageBox(NULL, TEXT("Function completed"), NULL, MB_OK); } LONG OilFilter1(TCHAR **ppchBuffer) ...Read now
Unlock full access