Originally posted by kirants
CWnd objects delete themselves when they are destroyed.
I guess it is PostNcDestroy handler which does a "delete this"
Most CWnd objects do not. The only ones I know of that do are the CFrameWnd class and those derived from it. If all CWnd objects did, then what would happen when a CWnd object is created as a member object and/or on the stack? Deleteing something from onthe stack is not good.