MFC Toolbar

Hiding the Default Toolbar

By default, the initial view contains a toolbar, as shown below:

The view containing a toolbar

To hide this toolbar, open MainFrm.cpp and just comment out lines 6 to 11 and lines 21 to 23 so that unnecessary instances won't be created.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
     
	//if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
//	!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
//{
//	TRACE0("Failed to create toolbar\n");
//	return -1;      // fail to create
//}
	
    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));

	// TODO: Delete these three lines if you don't want the toolbar to be dockable
	//m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
//EnableDocking(CBRS_ALIGN_ANY);
//DockControlBar(&m_wndToolBar);


	return 0;
}
After applying this code, the initial view will look like this:

The view without a toolbar