Re: Save Text from CEdit box?



Can someone give me some tips or point me to a tutorial to save the text from
a CEdit box to a file(txt file)? I've spent a lot of time on this already
with no solid results.


Something like:

void SaveTextFromCEdit(CEdit* pEdit, CString fileName)
{

ASSERT_VALID(pEdit);

CString str;
pEdit->GetWindowText(str);

CStdioFile file;

if((str.GetLength() > 0) && file.Open(fileName,
CFile::modeCreate|CFile::modeWrite))
{
file.WriteString(str);
file.Close();
}

}

---
Ajay

.