C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to deal with this problem

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
我是最好的
Guest





PostPosted: Sun Jun 18, 2006 8:21 am    Post subject: how to deal with this problem Reply with quote



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!
Back to top
Jerry Coffin
Guest





PostPosted: Sun Jun 18, 2006 8:43 am    Post subject: Re: how to deal with this problem Reply with quote



In article <1150600906.961101.27120
@p79g2000cwp.googlegroups.com>, dchen (AT) insun (DOT) hit.edu.cn
says...

[ MFC code elided ]

Quote:
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.
Back to top
Ian Collins
Guest





PostPosted: Sun Jun 18, 2006 8:46 am    Post subject: Re: how to deal with this problem Reply with quote



我是最好的 wrote:

[OT stuff]

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

--
Ian Collins.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.