O'Reilly logo

Windows® via C/C++, Fifth Edition by Christophe Nasarre, Jeffrey Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

EXCEPTION_CONTINUE_EXECUTION

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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required