Click here to Skip to main content
15,895,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _declspec and uuid Pin
Stephen Caldwell19-Jun-07 5:11
Stephen Caldwell19-Jun-07 5:11 
GeneralRe: _declspec and uuid Pin
Roger Stoltz19-Jun-07 5:12
Roger Stoltz19-Jun-07 5:12 
QuestionProblem with creating richeditctrl? Pin
Banks K19-Jun-07 3:05
Banks K19-Jun-07 3:05 
AnswerRe: Problem with creating richeditctrl? Pin
Rolando Cruz19-Jun-07 3:29
Rolando Cruz19-Jun-07 3:29 
GeneralRe: Problem with creating richeditctrl? Pin
Banks K19-Jun-07 3:36
Banks K19-Jun-07 3:36 
GeneralRe: Problem with creating richeditctrl? Pin
Rolando Cruz19-Jun-07 3:51
Rolando Cruz19-Jun-07 3:51 
QuestionFile reading problem Pin
Y_Kaushik19-Jun-07 3:05
Y_Kaushik19-Jun-07 3:05 
AnswerRe: File reading problem Pin
Rolando Cruz19-Jun-07 3:38
Rolando Cruz19-Jun-07 3:38 
Hi,

Rather than reading the contents of the txt file to a buffer and then create and write it to the new file why not just do both at the same time?

<br />
CStdioFile fSrc, fDest;<br />
<br />
// Open Source and Create Destination files<br />
...<br />
<br />
while (fSrc.ReadString(strLine))<br />
{<br />
fDest.WriteString(strLine);<br />
}<br />
<br />
fSrc.Close();<br />
fDest.Close();<br />



Also, in your code you are missing the first line of the text file.

while(fileObj.ReadString(strLine)) <-- moves file pointer to next line<br />
{<br />
   fileObj.ReadString(strLine); <-- reads next line. 1st line is gone!!<br />
   ...<br />
}



Finally, unless you are making changes or scrapping the text file for any data why not use the ::CopyFile function?

Hope this helps!


Rolando Suspicious | :suss:

AnswerRe: File reading problem Pin
Iain Clarke, Warrior Programmer19-Jun-07 4:08
Iain Clarke, Warrior Programmer19-Jun-07 4:08 
QuestionCOM/DCOM is now what? Pin
Rolando Cruz19-Jun-07 2:11
Rolando Cruz19-Jun-07 2:11 
AnswerRe: COM/DCOM is now what? Pin
bob1697219-Jun-07 4:34
bob1697219-Jun-07 4:34 
GeneralRe: COM/DCOM is now what? Pin
Rolando Cruz19-Jun-07 5:08
Rolando Cruz19-Jun-07 5:08 
AnswerRe: COM/DCOM is now what? Pin
James R. Twine19-Jun-07 4:51
James R. Twine19-Jun-07 4:51 
AnswerRe: COM/DCOM is now what? Pin
Rolando Cruz19-Jun-07 5:14
Rolando Cruz19-Jun-07 5:14 
GeneralRe: COM/DCOM is now what? Pin
Matthew Faithfull19-Jun-07 7:51
Matthew Faithfull19-Jun-07 7:51 
GeneralRe: COM/DCOM is now what? Pin
Rolando Cruz19-Jun-07 7:56
Rolando Cruz19-Jun-07 7:56 
QuestionUnable to launch dialog box Pin
Wamuti19-Jun-07 2:09
Wamuti19-Jun-07 2:09 
AnswerRe: Unable to launch dialog box Pin
Roger Stoltz19-Jun-07 2:40
Roger Stoltz19-Jun-07 2:40 
GeneralRe: Unable to launch dialog box Pin
Wamuti19-Jun-07 3:09
Wamuti19-Jun-07 3:09 
GeneralRe: Unable to launch dialog box Pin
Wamuti19-Jun-07 3:17
Wamuti19-Jun-07 3:17 
QuestionHow to: Structure initialization Pin
Programm3r19-Jun-07 0:01
Programm3r19-Jun-07 0:01 
AnswerRe: How to: Structure initialization Pin
Rage19-Jun-07 0:27
professionalRage19-Jun-07 0:27 
GeneralRe: How to: Structure initialization Pin
Programm3r19-Jun-07 0:47
Programm3r19-Jun-07 0:47 
QuestionDifference between DLL & Process ??? Pin
amitmistry_petlad 18-Jun-07 23:45
amitmistry_petlad 18-Jun-07 23:45 
AnswerRe: Difference between DLL & Process ??? Pin
Programm3r19-Jun-07 0:05
Programm3r19-Jun-07 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.