Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the concept of the Dr Watson for detecting the crash and restarting the application. Use the following:</p> <p>Set a Timer like:</p> <pre><code>SetTimer( eIsDwwin, 30000, NULL); </code></pre> <p>This will check the Dr Watson process after every 30 seconds in the system process using the following:</p> <pre><code>void CMainFrame::OnTimer(UINT nIDEvent) { case eIsDwwin: HANDLE hndl = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); DWORD dwsma = GetLastError(); DWORD dwExitCode = 0; PROCESSENTRY32 procEntry={0}; procEntry.dwSize = sizeof( PROCESSENTRY32 ); Process32First(hndl,&amp;procEntry); do { if(((!strcmpi(procEntry.szExeFile,"dwwin.exe"))|| (!strcmpi(procEntry.szExeFile,"drwatson.exe"))|| (!strcmpi(procEntry.szExeFile,"drwtsn32.exe"))|| (!strcmpi(procEntry.szExeFile,"WerFault.exe"))) &amp;&amp; (procEntry.th32ParentProcessID == GetCurrentProcessId())) { WSACleanup(); PostMessage( WM_CLOSE); Sleep(500); if(0==strcmpi(procEntry.szExeFile,"dwwin.exe")) { system("TASKKILL /IM dwwin.exe /F"); } else if(0==strcmpi(procEntry.szExeFile,"drwatson.exe")) { system("TASKKILL /IM drwatson.exe /F"); } else if(0==strcmpi(procEntry.szExeFile,"drwtsn32.exe")) { system("TASKKILL /IM drwtsn32.exe /F"); } else if(0==strcmpi(procEntry.szExeFile,"WerFault.exe")) { system("TASKKILL /IM WerFault.exe /F"); } else { system("TASKKILL /IM WerFault.exe /F"); } break; } } while(Process32Next(hndl,&amp;procEntry)); CloseHandle(hndl); break; } } </code></pre> <p>This will close the application which has crashed, gracefully.</p> <p>Anothe way would be to use the Signal API in Windows for handling the exceptions and crashes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload