开发者

Not able to read the contents in the file in MFC using the function Cfile?

I am not able to read the contents in the file if I manually write something in the file...If there are contents existing already am able to read the contents...but if I go and manually write something in the file and try to read I am not able to read the contents that I have edited..check the code below that I am using to read....

CFile file;
if(file.open("C:\\users\\rakesh\\Desktop\\myText.txt",CFile::modeRead))
{开发者_C百科 
return false;
}
TCHAR buffer[50];//say content is small
file.read(buffer,50);
file.close();


Looks like an unicode-problem. My guess is that your project is set to use unicode, but your editor writes ascii.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜