I am writing a program which on an Unhandledexception, I want it to re-open itself again. For this I have created an exception filter:
long ProgExceptionFilter(EXCEPT
ION_POINTE
RS* p)
{
if(p->ExceptionRecord->Exc
eptionCode
==EXCEPTIO
N_ACCESS_V
IOLATION
{
TCHAR(acModule[MAX_PATH];
GetModuleFileName(NULL, acModule, MAX_PATH);
ShellExecute(NULL, _T("open"), acModule, NULL, NULL, SW_SHOW);
return EXCEPTION_EXECUTE_HANDLER;
}
return EXCEPTION_CONTINUE_SEARCH;
}
This works but the problem is that the "restart" I had scheduled for 00:00 every day using (shutdown -r -f) no longer works because it cannot force the application with the above code to close.
Do yo have any ideas to overcome this problem?
Thank you .
Start Free Trial