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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display a text file in an edit box

Status
Not open for further replies.

sumedha

Programmer
Apr 12, 2000
15
LK
hi,<br>I'm new to vc++. using vc++6.<br>I want to display the contents of a text file in an edit box. I used the following code. but cannot seem to get the entire file (which is very small) to a single variable.<br><br>CString tempvar;<br>while (!feof(fehelp_file_ptr))<br>{<br>&nbsp;fscanf(fehelp_file_ptr,&quot;%s&quot;,tempvar);<br>&nbsp;m_fhelp= m_fhelp + tempvar;&nbsp;&nbsp;//this part does not work<br>}<br>UpdateData(FALSE);<br>fclose(fehelp_file_ptr);<br>//m_fhelp is the member variable of an edit box.<br><br>sumedha.
 
Apparantly , your program should work .But do one thing , instead of using the + operator. Just use strcat() function and see whether it works . Or just initialize the tempvar varible and then take input to it. <br><br>Does that solve your problem ?<br>Thanx<br>Siddhartha Singh<br><A HREF="mailto:ssingh@aztecsoft.com">ssingh@aztecsoft.com</A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top