如题.在SDI中加入Dialog bar控件,然后在控件中加入了一个按钮和一个combobox,按钮可以在View类里或MainFrame里通过class wizzard加入Message map进行消息映射;但是combobox怎么办呢?好像没办法从class wizzard里生成combobox的变量;
我想做的是combobox可以动态地添加,删除item,当然combobox的选取之类的事件也应该要有,该怎么办呢?

解决方案 »

  1.   

    以下摘自msdnCDialogBarA dialog bar is a control bar that contains standard Windows controls. It acts like a dialog in that it contains the controls and supports tabbing between them. It also acts like a dialog in that it uses a dialog template to represent the bar.A CDialogBar is used for the print-preview toolbar, which contains standard pushbutton controls.Using a CDialogBar is like using a CFormView. You must define a dialog template for the dialog bar and remove all the styles except WS_CHILD. Note that the dialog must not be visible.The control notifications for a CDialogBar will be sent to the parent of the control bar (just like toolbar buttons).CCmdUI Support for CDialogBarDialog bar buttons should be updated through the ON_UPDATE_COMMAND_UI handler mechanism. At idle time, the dialog bar will call the ON_UPDATE_COMMAND_UI handler with the command ID of all the buttons that have a ID >= 0x8000 (that is, in the range of command IDs).The ON_UPDATE_COMMAND_UI handler can call: Enable:  to enable or disable the button.
    SetText:  to change the text of the button. 
    Customization can be done through standard window manager APIs.
    也就是说所以你要处理控件,需要添加ON_UPDATE_COMMAND_UI( ID, memberFxn)memberFxnThe name of the message-handler function to which the message is mapped
      

  2.   

    这好像只说到了怎么处理事件啊!那就像Button事件的实现一样,我想要的是怎么往combobox里加item也就是内容.在class wizzard的message map里只有一些combobox的消息如select之类的而没有和combobox的addstring一样的那种函数