I have written a CString Object into Text file by using :
f.Write (&FileName,FileName.GetLength());//FileName is CString Object
Now I want to Read CString object back How this could be done?I am using code :
LPTSTR p = CurrentLanguageName.GetBuffer(11);
void *g=(void *)p;
f.Read (g,CurrentLanguageFileLen);
CurrentLanguageName.ReleaseBuffer( );
//But this method don't work.
Regards,
pri_skit 0
Newbie Poster
Recommended Answers
Jump to Postyou wrote it wrong -- what you wrote is the c++ class object, not the string contents. If the file is a normal text file where '\n' is line terminator then you need to tack on the '\n' to the end of the string then write only the string to …
All 4 Replies
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
ithelp 757
Posting Virtuoso Banned
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
pri_skit 0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.