Append Text on CEdit
void CFoo::AppendTextToEditCtrl(CEdit& edit, LPCTSTR pszText) { // get the initial text length int nLength = edit.GetWindowTextLength(); // put the selection at the end of text edit.SetSel(nLength, nLength); // replace the selection edit.ReplaceSel(pszText); }
for appending lines:
void CFoo::AppendLineToMultilineEditCtrl(CEdit& edit, LPCTSTR pszText) { CString strLine; // add CR/LF to text strLine.Format(_T("\r\n%s"), pszText); AppendTextToEditCtrl(edit, strLine); }
source: [here](http://forums.codeguru.com/showthread.php?318921-MFC-Edit-Control-How-to-append-text-to-an-edit-control)












