|
Prev: I just realised
Next: wxHashSet error
From: Eric Jensen on 23 Apr 2008 09:47 Hello Vadim, Friday, April 18, 2008, 2:23:49 AM, you wrote: EJ>> Your second idea worked though. Here is what we have now: EJ>> EJ>> void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event)) EJ>> { EJ>> //if(GetTopWindow()) GetTopWindow()->Close(true); EJ>> // Windows will terminate the process soon after we EJ>> // return from WM_ENDSESSION handler anyhow, so make EJ>> // sure we at least execute our cleanup code before EJ>> EJ>> if(wxTopLevelWindows.GetCount()>0) { EJ>> wxTopLevelWindows[0]->SetHWND(NULL); EJ>> } EJ>> EJ>> const int rc = OnExit(); EJ>> wxEntryCleanup(); EJ>> EJ>> // calling exit() instead of ExitProcess() or not doing EJ>> // anything at all and being killed by Windows has the EJ>> // advantage of executing the dtors of global objects EJ>> exit(rc); EJ>> } EJ>> EJ>> Saving the old HWND and calling ::DestroyWindow() on it later does not EJ>> work (leads to a crash). EJ>> EJ>> I'll do some more testing tomorrow. VZ> Please let me know if you discover any problems with this or whether I VZ> should go ahead and apply it. sorry for the late reply, only now had time to do some more testing. The above code seems to work fine. It still feels a bit like a dirty hack, but i guess that's what you need to circumvent Windows behavior sometimes ;) Thanks for your help. Regards, Eric
|
Pages: 1 Prev: I just realised Next: wxHashSet error |