-
toolbar in dialog apps
hi i have created a Wizard generated MFC dialog based application and a toolbar resource .
now when i am adding the toolbar in the initdialog part like with
CToolBar mytoolbar;
mytoolbar.CreateEx(this,TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | WS_CHILD | WS_VISIBLE );
mytoolbar.LoadToolBar(IDR_TOOLBAR);
I Don't seem to load the toolbar could anyone please tell me where i am wrong
regards
-
Perhaps you should move:
CToolBar mytoolbar;
into the header file. Seems to me when initdialog goes out of scope your "CToolBar mytoolbar" would too.
Also if you are using the Resource Editor to create the dialog box, you should put;
DDX_Control(pDX, IDC_TOOLBAR, mytoolbar);
in the DoDataExchange macro.