GetDocument()->SetModifiedFlag(FALSE);

解决方案 »

  1.   

    重载virtual CDocument::SaveModified(),return 1;什么也不做就可以了 
      

  2.   

    你可以设置 m_controlEcho 的enable属性为 false,不让手工输入就可以了 :P
      

  3.   

    谢谢valwang(力丸) ,我的问题,你说的对,可以解决,我把分給你。
      

  4.   

    在你的代码的最后一行加入:
    GetDocument()->SetModifiedFlag(FALSE);//假设在View中,如果不在可能要自己得到文档指针,可以参照如何得到当前活动文档对应的贴子!
      

  5.   

    或者响应CEditView的 EN_CHANGE ,但是里面不做任何事
      

  6.   

    在=EN_CHANGE事件中加上
    GetEditCtrl().SetModify(false);
      

  7.   

    哦,看来不用,只要响应EN_CHANGE个事件,里面不加上任何代码就行了
      

  8.   

    CEdit *m_controlEcho=&GetEditCtrl();
    int nCount = m_controlEcho->GetLineCount();
    if(0<=(nCount-=200))
    {
      m_controlEcho->SetReadOnly(FALSE);
      m_controlEcho->SetSel(0, m_controlEcho->LineIndex(nCount + 100), TRUE);
      m_controlEcho->Clear();
      m_controlEcho->SetReadOnly();
    }
    m_controlEcho->SetReadOnly(FALSE);
    CString str("\r\n");
    int nLength = m_controlEcho->GetWindowTextLength();
    str = lpsz + str;
    m_controlEcho->SetSel(nLength, nLength);
    m_controlEcho->ReplaceSel(str);GetDocument()->SetModifiedFlag(FALSE);//修改你的文档标志,不是Edit的文档标志,ok!