Home » Category » Microsoft Visual C & C++

Microsoft Visual C & C++: multiple dialog bars from same template

202| Fri, 08 Feb 2008 22:25:00 GMT| hjames5| Comments (2)
I know that when you create a dialog bar, in the constructor you specify the id of the dialog bar template as well as an id for the bar you are creating. My question is, If I want to create the same bar multiple times, could I just leave the same template id and specify another for each bar. Also, since the buttons on the template bar need to have handlers, is there a way to check which bar the button is on (since each new bar would have the same buttons with the ids specified from the template).

Basically, I need a different handler for every "ID_BUTTON1" on the different toolbars.

Thanks for your help,
James

Keywords & Tags: multiple, dialog, bars, same, template, microsoft, visual c++, vc

URL: http://www.7prog.com/visual-c-c++/210854/
 
«« Prev - Next »» 2 helpful answers below.
**BUMP**

I really need your help guys.

Thanks, James

hjames5 | Sun, 11 Nov 2007 01:04:00 GMT |

Create member of dialog bar requires BarID. Once you pass different IDs for each bar and store it for comparison, dialog bar can make a decision what command to send when button is pressed (GetDlgCtrlID) for each bar from button handler within dialog bar class.

By handling buttons inside dialog bar class, framework buttons update UI is bypassed, therefore you will have to override OnUpdateCmdUI in dialog bar passing FALSE for bDisableIfNoHndler in call to the base class, to keep buttons enabled.

johncz | Sun, 11 Nov 2007 01:05:00 GMT |

Microsoft Visual C & C++ Hot Answers

Microsoft Visual C & C++ New questions

Microsoft Visual C & C++ Related Categories