CTestDlg_1已经从CDialog继承
希望CTestDlg_2从CTestDlg_1继承
是不是只能手动继承?
希望CTestDlg_2中覆盖CTestDlg_1中的一些消息响应函数
应该怎么处理?
谢谢

解决方案 »

  1.   

    问题是在CTestDlg_2中的消息响应函数怎么写?
    是不是还是要这样写:
    在头文件:protected:
    // Generated message map functions
    //{{AFX_MSG(CTestDlg)
    afx_msg void OnClose();
    virtual BOOL OnInitDialog();
    afx_msg void OnOk();
    afx_msg void OnCancel();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()在cpp文件:BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
      //{{AFX_MSG_MAP(CTestDlg)
      ON_WM_CLOSE()
      ON_BN_CLICKED(IDC_OK, OnOk)
      ON_BN_CLICKED(IDC_CANCEL, OnCancel)
      //}}AFX_MSG_MAP
    END_MESSAGE_MAP()