cpp_prgmer wrote: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.
It makes no difference, as long as the data being read is accessible by the other dialog.
cpp_prgmer wrote:So one needs to store the data on2 a CString or like to Xfer the data to dat dlg.
The example I provided did store the data in a
cpp_prgmer wrote:Secondly, when u read file data u wud not know in advance how large the file length wud b...
Sure you would. I also showed this in the example. Did you not see it? Strangly enough, you used the same
CString::GetLength() call in your code snippet.
cpp_prgmer wrote:How abt having a fixed size buffer that reads data and does...
Like I previously indicated, multiple disk reads are not necessary, and can be detrimental to performance.
cpp_prgmer wrote:CString wud manage the hassles of mem mgmt and u have read all the data w/o any allocation work by urself.
CString does this, but how much trouble is it to use the
new operator once with the tradeoff being less disk I/O? Furthermore, the
CString += buffer statement can be a lot more expensive than a single use of the
cpp_prgmer wrote:Does CString have any limitations of not being able 2 store large data or newline probs etc??
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb