请注意,是CDialogBar而不是CDialog。CSDN里:
BOOL CDialogBar::Create( CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID );
最后一个参数的解释是
nID
The control ID of the dialog bar.
到底是什么意思?我随便填个数字进去,结果出来的CDialogBar上所有按钮都是灰色的。
我该怎样得知CDialogBar上哪个按钮被按下?

解决方案 »

  1.   

    DialogBar的控件ID;
    你可以在DialogBar的父窗口类中处理相应Dialog模板上按钮控件的消息事件:
        ON_COMMAND(IDC_BUTTON, OnButton)
        ON_UPDATE_COMMAND_UI(IDC_BUTTON, OnUpdateButton)
      

  2.   

    1. In Class "CMainFrame", add a member variable "CDialogBar m_wndDialogBar;".
    2. In the implementation of function CMainFrame::onCreate(), add "m_wndDialogBar.Create(this, IDD_MYDIALOGBAR,
          CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY, IDD_MYDIALOGBAR_ID);". IDD_MYDIALOGBAR_ID can be any unique value. IDD_MYDIALOGBAR is your dialog template.
    3. Use Class Cizarder add the message mapping function for the controls into class "CMainFrame".
      

  3.   


    问题是:
    我不懂如何为CDialogBar添加消息影射!!!!!!!!!!!
    给个简单的说明我就结贴了。