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