private:
EXCEPTION_RECORD m_er;// CPU independent exception information
CONTEXT m_context;// CPU dependent exception information };
int main(int argc,char* argv[]) {
CSE::MapSEtoCE();
try { // *(PBYTE) 0 = 0; // Access violation int x = 0;
x = 5 / x;// Division by zero } catch(CSE& se) { //switch(se) // Calls the operator DWORD() member function switch(se.GetExpCode()) { case EXCEPTION_ACCESS_VIOLATION: // This code handles an access-violation exception printf("EXCEPTION_ACCESS_VIOLATION\n"); break;
case EXCEPTION_INT_DIVIDE_BY_ZERO: // This code handles a division-by-zero exception printf("EXCEPTION_INT_DIVIDE_BY_ZERO\n"); break;
default: // We don't handle any other exceptions //throw; // Maybe another catch is looking for this break;// Never executes } }