ToolBar Problem

Hi,
In a dialog based application, there are a number of pop-menus.
I really want to set toolbars for them. How to setting these toolbars for dialog-based application?
Thanks in advance!
[208 byte] By [yuehui chen] at [2007-11-17 11:47:33]
# 1 Re: ToolBar Problem
There examples in Code guru itself if you would care to look under
toolbar
http://www.dev-archive.com/dialog/toolbars.shtml
http://www.dev-archive.com/dialog/PlacingAToolbarOnADlg.shtml
http://www.dev-archive.com/dialog/dlgtoolbar.shtml
http://www.dev-archive.com/dialog/tbdlg_ok.shtml

regards
Prem
prem_gali at 2007-11-10 8:06:35 >
# 2 Re: ToolBar Problem
Embed a CToolBar member( say m_wndToolbar ) in Ur dialog class. And also add toolbar template to the dialog resource( say IDR_TOOLBAR1 ). The following code will insert the toolbar to the dialog.

if ( !m_wndToolbar.Create(this ) || !m_wndToolbar.LoadToolBar( IDR_TOOLBAR1 ) )
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolbar.MoveWindow( CRect( 0, 0, 300, 30 ) );
chamindaG at 2007-11-10 8:07:37 >
# 3 Re: ToolBar Problem
Thanks for the anwsers!

I am not clearly understand about the relationship bewteen the Menu ID and the toolbar.
In addtion, what are the differences of the toolbar and the functional push-button?

Thanks,
yuehui chen at 2007-11-10 8:08:37 >
# 4 Re: ToolBar Problem
It is not necessary to have a relationship between menu-IDs and toolbar buttons. But if we provide same id of a menu item to a toolbar item then the same function will be called whether u click the menu or toolbar button.

we can provide the same program functionality either by using push buttons or toolbar. The use of either one is a sole option of the programmer. But in programmatically it is much easier to use toolbar rather than using push buttons in UI issues.
chamindaG at 2007-11-10 8:09:42 >
# 5 Re: ToolBar Problem
Ok, i understand. Where can i set the id of the single toolbar in order to find the responding function ot the
toolbar according to its ID?
yuehui chen at 2007-11-10 8:10:42 >
# 6 Re: ToolBar Problem
right click the toolbar ID in resource view and click properties. then select the particuler button( for this u need to press keep visible button on the top left corner of the properties dlg ). Now in the id field u can select an existing ID or type new one.
chamindaG at 2007-11-10 8:11:41 >