Posted
Filed under C,C++

[원문] : http://support.microsoft.com/kb/117320/ko

MFC 버전 2.5 이상을 사용하는 경우 수 활용하는 새 전역 MFC 함수, "AfxGetMainWnd", 코드를 단순화하기 위해:

   void ExitMFCApp()
   {
        // same as double-clicking on main window close box
        ASSERT(AfxGetMainWnd() != NULL);
        AfxGetMainWnd()->SendMessage(WM_CLOSE);
   }
				

참고 : 항상 문서의 데이터를 변경한 후 CDocument::SetModifiedFlag() 호출. 이 프레임워크는 종료 전에 저장할 것인지 묻는 것을 보장합니다. 종료 절차를 보다 광범위한 제어해야 CDocument::SaveModified()를 재정의할 수 있습니다.


2010/04/29 20:00 2010/04/29 20:00