Start New Discussion within our Software Development Community

I have created a toolbar in mfc. I want to add this toolbar on my dialog. So in the dialog's OnInitDialog() function I am trying to create this toolbar. But the toolbar is not coming. Please tell me how can create it.

BOOL CDlgsViewDlg::OnInitDialog()
	CToolBar toolBar;
        CRect	rcClientOld; // Old Client Rect
	CRect	rcClientNew; // New Client Rect with Tollbar Added
	GetClientRect(rcClientOld); // Retrive the Old Client WindowSize
	RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0,reposQuery,rcClientNew);
	return TRUE;  // return TRUE  unless you set the focus to a control