المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Reading from fstream in CString object



C++ Programming
04-03-2009, 09:03 AM
can anybody explain how can i read from a file in CString onject using fstream.
CString str
fstream fin
fin.open(^);
fin.read((char *)str.GetBuffer(0),str.GetLength()* sizeof(TCHAR));
fin.close

this code is not working while m able to write the same way in file but not able to read
fin.write((char *)str.GetBuffer(0),str.GetLength()*sizeof(TCHAR));

plz help thank u