I'm new to MFC. I have just created an SDI application with the wizard, then tried to modify the generated code to control the layout of each view, toolbar, or menu:
...
m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC)
...
DockPane(&m_wndToolBar); // m_wndToolBar is a tool bar
...
DockPane(&m_wndFileView);
m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
DockPane(&m_wndOutput);
// w_wndFileView, m_wndClassView, m_wndOutput are some views.
...
But it seems that it doesn't work: the windows always behave like they remember what the user operated at last time. For example, the last 3 lines of codes creates 3 views like this:
I run the code and closed, then modified them to:
DockPane(&m_wndFileView);
DockPane(&m_wndOutput);
m_wndClassView.AttachToTabWnd(&m_wndOutput, DM_SHOW, TRUE, &pTabbedBar);
I suppose it should appear like this but failed (This screenshot is not the run result, I changed the layout manually):
It keeps the layout as last time when closed (as picture 1). Additionally, any user's manual change of layout can remembered. So, why? Who said to do so?