how to deal with this problem

G

Guest

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!
 
J

Jerry Coffin

@p79g2000cwp.googlegroups.com>, (e-mail address removed)
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.
 
I

Ian Collins

我是最好的 wrote:

[OT stuff]

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top