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

مشاهدة النسخة كاملة : csv file problem



C++ Programming
04-02-2010, 08:31 AM
hi,
i m reading data of csv file in a char buffer like this
CFile shopCart(strFileName,CFile::modeRead);
char buff[5000]={0};
shopCart.Read(buff,sizeof(buff));
and then saving changes before closing application in this way.

CFile::Remove(strFileName);
CFile csvFile(strFileName,CFile::modeWrite |CFile::modeCreate );
strCSV = L"|" + strCSV+ char(13) + char(10);
csvFile.Write(strCSV,strCSV.GetLength()*sizeof(TCHAR));

problem is that at first exec buffer holds data of all the file but after closing and re exec buffer contains only one character of file even though file contains same data after updation.wat can be the problem may b?