Why doesn't the process be terminated?
-
I have exited my application,why the process still lives in the "Windows Task manager"??? Plese help me! Rap off for you,for me,for our human.
-
I have exited my application,why the process still lives in the "Windows Task manager"??? Plese help me! Rap off for you,for me,for our human.
Two reasons I can think of. One is common, another is more rare. The common reason is that you haven't actually posted a quit message to the thread, so the thread is blocked waiting for a message that will never arise. This is more common in Win32 SDK programs. You should PostQuitMessage in response to a WM_NCDESTROY message. If using MFC, it should have done this for you, unless you've overloaded PostNcDestroy and not called the base class, IIRC. The rare reason is that something has deadlocked in DllMain. You can get this problem if you try to wait for an object in DllMain, or sometimes if you release a COM object in a static object's destructor. Check the rules for DllMain. Destructors for static objects run in the scope of DllMain for static objects in DLLs.