怎样重载CPropSheet的“确定” “取消” “应用”等按纽的响应函数

解决方案 »

  1.   

    这些都可以在CPropertyPage中进行重载OnOK, OnCancel, OnApply
      

  2.   

    你可以分别重载CPropertyPage中的虚函数
    virtual void OnOK( );
    virtual void OnCancel( );
    virtual BOOL OnApply( );
    例如在*.h中
    // Generated message map functions
    //{{AFX_MSG(CCBExTestDlg)
    virtual void OnOK( );
    virtual void OnCancel( );
    virtual BOOL OnApply( );
    //}}AFX_MSG
    在*。cpp中实现
    void CCBExTestDlg::OnOK() 
    {
      // TODO: Add extra validation here

      CPropertyPage::OnOK();
    }

    Good luck!
      

  3.   

    在你的.h文件中添加:
    下面两行 
              //{{AFX_MSG(CYourPropertySheet)
    // NOTE - the ClassWizard will add and remove member functions here.

              afx_msg void OnOK();
     afx_msg void OnCancel();
    //}}AFX_MSG