void COutputView::MsgOut(CString strMsg)
{
    // 获取CEditView的内嵌编辑控件
    CEdit& theEdit = GetEditCtrl();
    int nSel = theEdit.GetWindowTextLength();    // 选中编辑控件最后一个位置的字符并用所要显示的字符串替换它
    theEdit.SetSel(nSel,nSel);
    strMsg += "\r\n";
    theEdit.ReplaceSel(strMsg);
}
请问大家,MsgOut这个函数是库里的函数,还是自己的声明的函数呢?

解决方案 »

  1.   

    这个好像是COutputView自己声明的函数。
      

  2.   

    你的 COutputView  是从哪个类继承下来的?假如从 CView ,你就 CView::      看成员列表中是否有MsgOut 函数。
      

  3.   

    MSDN也没有此函数,楼主何必执着.
      

  4.   

    void COutputView::MsgOut(CString strMsg)
    {
        // 获取CEditView的内嵌编辑控件
        CEdit& theEdit = GetEditCtrl();
        int nSel = theEdit.GetWindowTextLength();    // 选中编辑控件最后一个位置的字符并用所要显示的字符串替换它
        theEdit.SetSel(nSel,nSel);
        strMsg += "\r\n";
        theEdit.ReplaceSel(strMsg);
    }
    功能就是把编辑框的内容再copy一遍,在写回到编辑框中.比如编辑框汇中内容:
    1223
    调用该函数以后编辑框中的内容:
    1223
    1223
      

  5.   

    有一个小问题:
    最后的结果是
    1223
    strMsg里面的内容