The following code I used to create a toolbar in rebar.wndOwner is a dialog box.
The following is the status
1)Tool bar works in the dialog box, but withhout tool tips which I added in the resource editor for IDR_TOOLBAR1.
(as prompt = \nClose like that)
2) My code to add the toolbar to rebar band is failing. As indicated in the last line of the code.

Please note that I am using ATL & WTL classes.


void CreateRebarWithToolbar(CWindow& wndOwner,CReBarCtrlT<CWindow>& rbCtrl,CToolBarCtrlT<CWindow>& tbCtrl)
{
DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS| WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_NODIVIDER;
DWORD dwExStyle = WS_EX_TOOLWINDOW;

rbCtrl.Create(wndOwner,0,0,dwStyle,dwExStyle);
ATLASSERT(rbCtrl.IsWindow());

REBARINFO rbi;
rbi.cbSize = sizeof(REBARINFO);
rbi.fMask = 0;
rbi.himl = (HIMAGELIST)NULL;

ATLVERIFY(rbCtrl.SetBarInfo(&rbi));
//I tried this also
//rbCtrl = CFrameWindowImplBase<>::CreateSimpleReBarCtrl(wndOwner);
//ATLASSERT(rbCtrl.IsWindow()); works fine!

tbCtrl = CFrameWindowImplBase<>::CreateSimpleToolBarCtrl(wndOwner, IDR_TOOLBAR1, FALSE,ATL_SIMPLE_TOOLBAR_STYLE );
ATLASSERT(tbCtrl.IsWindow());
DWORD dwBtnSize = tbCtrl.GetButtonSize();

REBARBANDINFO rbBand;
::ZeroMemory(&rbBand,sizeof(REBARBANDINFO));
rbBand.cbSize = sizeof(REBARBANDINFO);
rbBand.lpText = _T("Tool Bar");
rbBand.hwndChild = tbCtrl.m_hWnd;
rbBand.cxMinChild = 0;
rbBand.cyMinChild = HIWORD(dwBtnSize);
rbBand.cx = 250;

ATLASSERT(::IsWindow(rbBand.hwndChild));

BOOL b = rbCtrl.AddBand(&rbBand);//b is FALSE


}