November 2007
Intermediate to advanced
848 pages
27h 15m
English
The examples have been pretty tame so far. Let’s shake things up a bit by adding a function call:
TCHAR g_szBuffer[100];
void FunclinRoosevelt2() {
TCHAR *pchBuffer = NULL;
__try {
FuncAtude2(pchBuffer);
}
__except (OilFilter2(&pchBuffer)) {
MessageBox(...);
}
}
void FuncAtude2(TCHAR *sz) {
*sz = TEXT('\0');
}
LONG OilFilter2 (TCHAR **ppchBuffer) {
if (*ppchBuffer == NULL) {
*ppchBuffer = g_szBuffer;
return(EXCEPTION_CONTINUE_EXECUTION);
}
return(EXCEPTION_EXECUTE_HANDLER);
}When FunclinRoosevelt2 executes, it calls FuncAtude2, passing it NULL. When FuncAtude2 executes, an exception is raised. Just as before, the system evaluates the exception filter associated with the most recently executing try block. In this example, ...
Read now
Unlock full access