2014년 7월 17일 목요일

[MFC] SDI 에서 (MENU) 없에기


BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWndEx::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs
cs.style &= ~FWS_ADDTOTITLE;
cs.hMenu = NULL; //요놈을 추가한다.
return TRUE;
}

'cs.hMenu = NULL;'을 추가하고 디버깅시 assertion failed이 날때

ON_WM_CREATE()

static UINT indicators[] =
{
ID_SEPARATOR,           // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};

if (!m_wndstatusbar.create(this))
{
trace0("failed to create status bar\n");
return -1;      // fail to create
}
m_wndstatusbar.setindicators(indicators, sizeof(indicators)/sizeof(uint));

위의 코드들을 주석또는 삭제

댓글 없음:

댓글 쓰기