Link to home
Start Free TrialLog in
Avatar of rkcth
rkcth

asked on

Read CFile into CString

I need a file in CString format. I am using CFile. Could someone please tell me how to get the information stored in the CFile into a CString.
Thanks,
Sincerely Robert
ASKER CERTIFIED SOLUTION
Avatar of freshmeat
freshmeat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rkcth
rkcth

ASKER

Well actually I can do it with a buffer, I want to do it without having to repeat the read process several times with my buffer. I guess it is not possible?
then you may set the buffer large enough, such as:

char szBuffer[myFile.Length]

thank u for ur points, that is what i like
^@^
freshmeat,

char szBuffer[myFile.Length]

Have you actually tried this code?  I do not believe this code will work.  You cannot create an array dynamically like you're trying to.  How else would you do this?

I actually have the same problem, but also do not wish to repeated read the file and add it to the string.

Cheers,
Cameron