Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

Here is the code snippet that allows you to dock an m_wndToolBar2 toolbar to the right side of an m_wndToolBar1 toolbar in the same row.

CRect wrAlreadyDockedBar;
m_wndToolBar1.GetWindowRect( &wrAlreadyDockedBar );
wrAlreadyDockedBar.OffsetRect( 1, 0 );
DockControlBar(&m_wndToolBar2,AFX_IDW_DOCKBAR_TOP,&wrAlreadyDockedBar);
RecalcLayout();