CMFCToolBar* WorkspacePane::CreateToolBar(CRuntimeClass* type, UINT id, UINT style) { AFXASSUME(type); CMFCToolBar* toolBar = dynamic_cast<CMFCToolBar*>(type->CreateObject()); ENSURE(toolBar); toolBar->Create(this, style | WS_TABSTOP, id); toolBar->ModifyStyleEx(0, WS_EX_CONTROLPARENT); toolBar->LoadToolBar(id, 0, 0, TRUE); if (PrivateToolBar* p = dynamic_cast<PrivateToolBar*>(toolBar)) p->AdjustStyle(); toolBar->SetRouteCommandsViaFrame(FALSE); toolBar_ = toolBar; return toolBar; }