|I have some doubts with regards using the above method.
Now the data may need to b displayed on Editcontrol whih is on a different dlg than the one from which the read request has been initiated. So one needs to store the data on2 a CString or like to Xfer the data to dat dlg.
Secondly, when u read file data u wud not know in advance how large the file length wud b, so allocation of a very large buffer wud not b advisable. How abt having a fixed size buffer that reads data and does
DWORD dwBytesRemaining = FileToRead.GetLength();
UINT nBytesRead = FileToRead.Read( buffer, sizeof(buffer) );
CString += buffer;
dwBytesRemaining -= nBytesRead;
CString wud manage the hassles of mem mgmt and u have read all the data w/o any allocation work by urself. Does CString have any limitations of not being able 2 store large data or newline probs etc??