특별한딸기이야기

AppWizard에서 프로젝트 생성시... 본문

딸기 공부방/MFC공부방

AppWizard에서 프로젝트 생성시...

특별한녀석 2008. 1. 9. 01:12
AppWizard에서 프로젝트 생성시 1단계에서 'Document / View architecture support?'옵션을 선택하지 않았을 경우

클래스 위자드에서 CMainFrame에 WM_CREATE를 추가한다

그리고 코드를 아래와 같이 교체한다.

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  return -1;
 
 // TODO: Add your specialized creation code here
 if(!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CRect(0, 0, 0, 0), this,
  AFX_IDW_PANE_FIRST, NULL))
 {
  TRACE0("Failed to create view window\n");
  return -1;
 }
 
 return 0;
}