Hi, Try the below code. It will work for sure.
if (!m\_wndToolBarMaha.CreateEx(this, TBSTYLE\_FLAT, WS\_CHILD | WS\_VISIBLE | CBRS\_TOP
| CBRS\_GRIPPER | CBRS\_TOOLTIPS | CBRS\_FLYBY | CBRS\_SIZE\_DYNAMIC ) )
{
TRACE0("Failed to create toolbar\\n");
return -1; // fail to create
}
CWinApp\* pApp= AfxGetApp();
m\_TBarImages.Create(32, 32, ILC\_COLOR, 4, 4);
m\_TBarImages.SetBkColor( RGB( 192, 192, 192 ) );
m\_TBarImages.Add(pApp->LoadIcon(IDI\_ICON1));
m\_TBarImages.Add(pApp->LoadIcon(IDI\_ICON2));
m\_TBarImages.Add(pApp->LoadIcon(IDI\_ICON3));
m\_wndToolBarMaha.GetToolBarCtrl().SetImageList(&m\_TBarImages);
m\_wndToolBarMaha.LoadToolBar(IDR\_MAINFRAME);
// TODO: Delete these three lines if you don't want the toolbar to be dockable
m\_wndToolBarMaha.EnableDocking(CBRS\_ALIGN\_ANY);
EnableDocking(CBRS\_ALIGN\_ANY);
DockControlBar(&m\_wndToolBarMaha);
Mahadev