把文本框的内容逐行写入txt,写入已经实现,如何换行写入?
void CDemoView::OnAdd()
{
// TODO: Add your control notification handler code here
CString strWord,strType,strResult;
m_Word.GetWindowText(strWord);
m_Type.GetWindowText(strType);
strResult = strWord+" "+strType+";
m_ShowList.AddString(strResult);
const char *ch=(LPCTSTR)strResult;
CFile file(_T("userdic.txt "), CFile::modeWrite|CFile::modeCreate);
file.Write(ch,strlen(ch));
file.Close();
}
请高手帮忙解决 每次点击添加 txt只有一行内容 如何实现逐行输入?