Using txt file in Program

How can I use data from a text file where every line becomes a CString when you go through the file? Thanks
[107 byte] By [mexican] at [2007-11-17 11:50:04]
# 1 Re: Using txt file in Program
Look up CStdioFile, CFile and CStdioFile::ReadString() function

// create new text file

CString str = "C:\\file.txt";
CStdioFile file;
CFileException exception;
CString line;

file.Open(str, CFile::modeRead, &exception);
file.ReadString(line); // put this in a loop to read the whole file
file.Close();

If you found this post to be helpful, please rate it to let others know it was useful.
bluesource at 2007-11-10 8:06:52 >