Click here to Skip to main content
15,916,215 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: saveFileDialog Pin
toxcct28-Aug-04 7:58
toxcct28-Aug-04 7:58 
GeneralRegistry Corruption Pin
aman200627-Aug-04 9:10
aman200627-Aug-04 9:10 
GeneralRe: Registry Corruption Pin
David Crow27-Aug-04 9:25
David Crow27-Aug-04 9:25 
GeneralRe: Registry Corruption Pin
aman200627-Aug-04 10:42
aman200627-Aug-04 10:42 
GeneralRe: Registry Corruption Pin
David Crow27-Aug-04 11:00
David Crow27-Aug-04 11:00 
GeneralRe: Registry Corruption Pin
Michael Dunn27-Aug-04 21:01
sitebuilderMichael Dunn27-Aug-04 21:01 
QuestionNeed to insert text? Pin
Larsson27-Aug-04 9:04
Larsson27-Aug-04 9:04 
AnswerRe: Need to insert text? Pin
David Crow27-Aug-04 9:33
David Crow27-Aug-04 9:33 
Well, you could read the file in line-by-line and output each line to a temporary file. When you get to the line in question, output the additional text.

If, however, you can read the file in as one big blob, you can use one of the various 'find' functions (e.g., CString::Find()) to locate the text. Write everything up to that point to a temporary file. Insert the additional text. Write the remainder of the original file to the temporary file.

In either case, when done, close both files, delete the original file, and rename the temporary file.


"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


GeneralRe: Need to insert text? Pin
Larsson27-Aug-04 10:03
Larsson27-Aug-04 10:03 
GeneralRe: Need to insert text? Pin
David Crow27-Aug-04 10:38
David Crow27-Aug-04 10:38 
QuestionInsert text to file? Pin
Larsson27-Aug-04 8:44
Larsson27-Aug-04 8:44 
AnswerRe: Insert text to file? Pin
darkbyte27-Aug-04 13:58
darkbyte27-Aug-04 13:58 
GeneralDoc/View and permanent/temporary handle maps Pin
herbert_chow27-Aug-04 8:24
herbert_chow27-Aug-04 8:24 
GeneralRe: Doc/View and permanent/temporary handle maps Pin
Neville Franks27-Aug-04 11:34
Neville Franks27-Aug-04 11:34 
Generalextern "C" in VisualStudio Pin
Marcello27-Aug-04 5:58
Marcello27-Aug-04 5:58 
GeneralRe: extern "C" in VisualStudio Pin
darkbyte27-Aug-04 13:38
darkbyte27-Aug-04 13:38 
GeneralRe: extern "C" in VisualStudio Pin
Marcello27-Aug-04 14:32
Marcello27-Aug-04 14:32 
GeneralRe: extern "C" in VisualStudio Pin
darkbyte27-Aug-04 15:49
darkbyte27-Aug-04 15:49 
GeneralRe: extern "C" in VisualStudio Pin
Marcello28-Aug-04 18:59
Marcello28-Aug-04 18:59 
GeneralRe: extern "C" in VisualStudio Pin
darkbyte27-Aug-04 16:03
darkbyte27-Aug-04 16:03 
GeneralRe: extern "C" in VisualStudio Pin
Marcello28-Aug-04 12:32
Marcello28-Aug-04 12:32 
GeneralRe: extern "C" in VisualStudio Pin
Marcello28-Aug-04 19:00
Marcello28-Aug-04 19:00 
GeneralRe: extern "C" in VisualStudio Pin
Marcello28-Aug-04 19:07
Marcello28-Aug-04 19:07 
Generalsocket error WSAEFAULT Pin
ns27-Aug-04 4:54
ns27-Aug-04 4:54 
QuestionSDI-App in regular DLL with its own message queue? Pin
Dawn_x27-Aug-04 4:27
Dawn_x27-Aug-04 4:27 

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.