Question : Append string from editbox to text file

Hello Expert, newbies in MFC here

may I ask other problem solution

If my application have five edit boxes, declare as string member variable.
1. How can I save/store each string the edit boxes in a text file.
2.let say, in every 5 minute, string in the edit boxes will update with new value, and I want to save/store append in new line in text file. never deleted the old value

I was trying to write it with CArchive technique, but the text cannot append. Then I used CStdio to append the file, but it successful to a write a string from just one edit box. I dont have any idea how to write in case more than one edit boxes.

Thank and Regard  

Answer : Append string from editbox to text file


CStdioFile File;
     File.Open("myFile.txt",CFile::modeNoTruncate | CFile::modeCreate |
            CFile::modeWrite);
     File.SeekToEnd();

     CString s;

GetDlgItemText(IDC_EDIT1, s);
File.WriteString(s);

GetDlgItemText(IDC_EDIT2, s);
File.WriteString(s);

GetDlgItemText(IDC_EDIT3, s);
File.WriteString(s);

...... and so on

     File.Close();


Random Solutions  
 
programming4us programming4us