Well, there are four steps.
1, CToolBar m_ToolBar; // Meanwhile you create a resource (eg IDR_TOOLBAR1) CToolBar m_ToolBar; // Meanwhile you create a resource (eg IDR_TOOLBAR1)
2, call the CToolBar Create function
m_ToolBar.Create(this);
3, call the function LoadToolBar
m_ToolBar.LoadToolBar(IDR_TOOLBAR1);
4. The most important step is to call RepositionBars
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
source share