求助~~
如题,都需要在.h和.cpp的什么位置添加什么?
谢谢大侠们~

解决方案 »

  1.   

    类, 属性里选 EN_CHANGE 消息
      

  2.   

    RichEditView,不是RichEditCtrl
      

  3.   

    如果是 DOC/VIEW 框架的, 继承自RichEditView 的类有个 =EN_CHANGE 消息
      

  4.   

    在RichEditView的OnInitialUpdate调用 GetRichEditCtrl()->SetEventMask(ENM_CHANGE);
      

  5.   

    在RichEditView的OnInitialUpdate调用 GetRichEditCtrl().SetEventMask(ENM_CHANGE);头文件中
    protected:// Generated message map functions
    protected:
    //{{AFX_MSG(CMyRichEditView)
    // NOTE - the ClassWizard will add and remove member functions here.
    //    DO NOT EDIT what you see in these blocks of generated code !
    afx_msg void OnDestroy();
    afx_msg void OnChange(); //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };cpp文件中
    BEGIN_MESSAGE_MAP(CMyRichEditView, CRichEditView)
    //{{AFX_MSG_MAP(CMyRichEditView)
    // NOTE - the ClassWizard will add and remove mapping macros here.
    //    DO NOT EDIT what you see in these blocks of generated code!
    ON_WM_DESTROY()
    ON_CONTROL_REFLECT(EN_CHANGE, OnChange) //}}AFX_MSG_MAP
    // Standard printing commands
    ON_COMMAND(ID_FILE_PRINT, CRichEditView::OnFilePrint)
    ON_COMMAND(ID_FILE_PRINT_DIRECT, CRichEditView::OnFilePrint)
    ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRichEditView::OnFilePrintPreview)
    END_MESSAGE_MAP()
    void CMyRichEditView::OnChange() 
    {
    // TODO: If this is a RICHEDIT control, the control will not
    // send this notification unless you override the CRichEditCtrl::OnInitDialog()
    // function and call CRichEditCtrl().SetEventMask()
    // with the ENM_CHANGE flag ORed into the mask.

    // TODO: Add your control notification handler code here
    }