Jesteś tutaj
__try/__except - jak złapać EXCEPTION_ACCESS_VIOLATION
http://msdn.microsoft.com/en-us/library/swezty51(VS.80).aspx
int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
{
if (code == EXCEPTION_ACCESS_VIOLATION)
{
return EXCEPTION_EXECUTE_HANDLER;
}
else
{
return EXCEPTION_CONTINUE_SEARCH;
};
}
void test()
{
__try
{
*((char *)(NULL)) = 2;
}
__except(filter(GetExceptionCode(), GetExceptionInformation()))
{
cout << "wicked :)";
}
}
Kategorie:
- Blog
- 2675 odsłon

Odpowiedzi
Albo prościej: __except(
Albo prościej:
__except( GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ) { ...Odpowiedz