I have developed a console ATL application and want to trap to close? Exit? Finish? The event is so that I can close the log files and I'll be able to clean normally on exit.
How can I get an 'end' event which will come as a result of someone ending .exe in Task Manager?
Edit:
This is a console application, I've attached the main square. Can you possibly indicate that the SetConsoleCtrlHandler
// override catech AAA module TR members int WinMain (int nShowCmd) thro () {if (CAtlBaseModule :: M_bInitFailed ) // ctor refusal somewhere {ATLASSERT (0); Return -1; } HRESULT hr = S_OK; LPTSTR lpCmdLine = GetCommandLine (); // _ATL_MIN_CRT if this line is required (ParseCommandLine (lpCmdLine, & amp; Hour)) {if (SUCCEEDED (RegisterClassObjects (CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE))} {CComPtr & LT; IRORCAdapterMain & gt; Padapter; If (SUCCEEDED (pAdapter.CoCreateInstance (L "RORCAdapter.RORCAdapterMain")) {if (SUCCEEDED (pAdapter-> StartAdapter ()) {MSG msg; while (GetMessage (& msg, 0, 0, 0)) Despatchmail You can not do "itemprop =" text "> text after" div "=};}}
"End process" on the Applications tab in the Task Manager, your main WM_CLOSE message in window To give feedback.
It assumes that your ATL app is a Windows GUI application. If it is a console application, you need to see SetConsoleCtrlHandler.
Comments
Post a Comment