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
mytoolbar.CreateEx(this,TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | WS_CHILD | WS_VISIBLE );
I Don't seem to load the toolbar could anyone please tell me where i am wrong
Perhaps you should move:
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.