CDialogBar在哪个函数中初始化成员变量?(除了构造函数外)OnInitDialog()在CDialogBar中无效,因为CDialogBar不是从CDialog中派生的

解决方案 »

  1.   

    InitDialogBarHandler(WORD wParam, DWORD lParam)
      

  2.   

    这个函数怎麽加呀??我自己的派生了CDialogBar类,但是类向导里没有我派生的这个类!
      

  3.   

    在派生类的头文件中添加如下:
    // Implementation
    protected: // Generated message map functions
    //{{AFX_MSG(CDlgModTemplate)
    afx_msg void InitDialogBarHandler( WORD wParam , DWORD  lParam );
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()在派生类.cpp文件中添加如下:
    BEGIN_MESSAGE_MAP(CDlgModTemplate, CDialogBar)
    //{{AFX_MSG_MAP(CDlgModTemplate)
    ON_MESSAGE(WM_INITDIALOGBAR , InitDialogBarHandler )
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()
      

  4.   

    自己手动加吧!这是CDialogBar的原型
    //{{AFX_MSG_MAP(CDialogBar)
    BEGIN_MESSAGE_MAP(CDialogBar, CControlBar)
    ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
    END_MESSAGE_MAP()
    //}}AFX_MSG_MAP
      

  5.   

    动手添加后会出现下列错误:
    error C2065: 'WM_INITDIALOGBAR' : undeclared identifier应该怎么办?