By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 992 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

how to deal with this problem

P: n/a
CString inputf="wc.txt";
CFile iFile( _T(inputf), CFile::modeCreate|CFile::modeReadWrite);
char buf[100*1024];
iFile.Read(buf,100*1024);
CString csml;
csml=buf;
csml.Replace("&nbsp;<"," ");
iFile.Write(csml,strlen(csml));
iFile.Close();
//-------------------------------------------------------------------------*-------

this code reads the content of wc.txt to csml, and replace the
characters with " ", then save the result to wc.txt.
but unfortunately, bad things happen, the goal doesn't achieved.
i think the reason is the program can't find the end of the string
"\0".
i want to ask how to deal with it?
thanks very much!

Jun 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <1150600906.961101.27120
@p79g2000cwp.googlegroups.com>, dc***@insun.hit.edu.cn
says...

[ MFC code elided ]
this code reads the content of wc.txt to csml, and replace the
characters with " ", then save the result to wc.txt.
but unfortunately, bad things happen, the goal doesn't achieved.


If you want some advice about how to do something at
least vaguely similar in a standard fashion, we might be
able to help out, but if you want advice about using MFC,
you'll probably need to ask somewhere that it's topical.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jun 18 '06 #2

P: n/a
我是最好的 wrote:

[OT stuff]

Please don't multi-post. If you wish to post to more than one group,
cross-post.

--
Ian Collins.
Jun 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.