Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CBuilder begginer...help

Status
Not open for further replies.

larcrik

Programmer
Aug 29, 2007
11
DE
hello. I'm a new user of CBuilder,..and I need some help.I want to read a file and work with lines, searching for a word.I want those lines to write them in a RichEdit box. How can I do that? (considering the fact that "istream" uses strings and RichEdit uses AnsiStrings?)
 
Rate your skill in the following
- reading a text file line by line into a std::string
- searching a std::string for a word
- creating a RichEdit box
- adding an AnsiString to the RichEdit box
- converting a std::string to an AnsiString

In other words, which is the part of the problem which has you stumped, and what have you tried so far?


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
I constantly use stream and strings. I simply use .c_str() to do the conversion back and forth.


James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
Thank you Salem for your advice. I did all of the tasks except the last one. I just can't seem to convert the string into AnsiString after I read and find my word in that file.
I tried to modify my file until all I have to do is to load the file into the RichEditBox. But if I do that, I can't open the modified file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top