sujan.dasmahapa 0 Light Poster

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()
{
	CDialog::OnInitDialog();
	CToolBar toolBar;
        CRect	rcClientOld; // Old Client Rect
	CRect	rcClientNew; // New Client Rect with Tollbar Added
	GetClientRect(rcClientOld); // Retrive the Old Client WindowSize
	toolBar.Create(this);
	toolBar.LoadToolBar(IDR_MAINFRAME);
	RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0,reposQuery,rcClientNew);
	return TRUE;  // return TRUE  unless you set the focus to a control
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.