Click here to Skip to main content
15,905,233 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to trap command window that appears while executing a C++ prog... Pin
ColinDavies26-Jul-02 23:52
ColinDavies26-Jul-02 23:52 
GeneralRe: how to trap command window that appears while executing a C++ prog... Pin
Nish Nishant27-Jul-02 0:08
sitebuilderNish Nishant27-Jul-02 0:08 
GeneralRe: how to trap command window that appears while executing a C++ prog... Pin
ColinDavies27-Jul-02 0:13
ColinDavies27-Jul-02 0:13 
Questionhow to trap command window that appears while executing a C++ prog... Pin
Pankaj Singh26-Jul-02 23:08
Pankaj Singh26-Jul-02 23:08 
QuestionHow can I use CListCtrl's LVS_REPORT Pin
Angel Kid26-Jul-02 22:16
Angel Kid26-Jul-02 22:16 
AnswerRe: How can I use CListCtrl's LVS_REPORT Pin
Philip Patrick26-Jul-02 23:47
professionalPhilip Patrick26-Jul-02 23:47 
Generalthank you,your are really good! Pin
Angel Kid27-Jul-02 4:33
Angel Kid27-Jul-02 4:33 
QuestionHow to replace last line of a file? Pin
Jon Taylor26-Jul-02 22:14
Jon Taylor26-Jul-02 22:14 
I'm working on an app that dumps loads of trace information to a file, as XML:

<log>
<message>
....
</message>
</log>

Now, when the app closes I write "</log>" as the last line. However, the next time the app is run, I want to append to this file, which means I must remove that last line. (It's the XML "root node" Smile | :) )

Now, I know I can rename the file, re-parse it and re-write it etc but these log files reach 10's of Mb in size, so it takes too long to do that.

So I want to over-write the last line with some new text instead. I seem to remember doing this using the C standard library in the dim and distant past, but can I do this using the C++ library?!! Mad | :mad:

I've tried with the <fstream> library, and seekp() & tellp() but am getting a bit unstuck Unsure | :~ Any ideas anyone?
AnswerRe: How to replace last line of a file? Pin
Nish Nishant26-Jul-02 22:40
sitebuilderNish Nishant26-Jul-02 22:40 
GeneralRe: How to replace last line of a file? Pin
l a u r e n27-Jul-02 1:10
l a u r e n27-Jul-02 1:10 
AnswerRe: How to replace last line of a file? Pin
Sharad Ganesh27-Jul-02 4:11
Sharad Ganesh27-Jul-02 4:11 
Generalcmb1 (and edt1) and OFN_EXPLORER Pin
Atlantys26-Jul-02 21:08
Atlantys26-Jul-02 21:08 
GeneralGDI Rotation Question Pin
jonbrown26-Jul-02 20:23
jonbrown26-Jul-02 20:23 
GeneralHelp in CStatic Pin
SamirSood26-Jul-02 19:30
SamirSood26-Jul-02 19:30 
GeneralRe: Help in CStatic Pin
l a u r e n27-Jul-02 1:18
l a u r e n27-Jul-02 1:18 
GeneralTiff image format and CMYK color mode Pin
storein26-Jul-02 18:29
storein26-Jul-02 18:29 
GeneralRe: Tiff image format and CMYK color mode Pin
storein26-Jul-02 18:55
storein26-Jul-02 18:55 
GeneralRe: Tiff image format and CMYK color mode Pin
Chris Losinger27-Jul-02 5:46
professionalChris Losinger27-Jul-02 5:46 
GeneralRe: Tiff image format and CMYK color mode Pin
storein27-Jul-02 20:00
storein27-Jul-02 20:00 
GeneralHelp me . Pin
storein28-Jul-02 16:47
storein28-Jul-02 16:47 
GeneralRe: Help me . Pin
storein28-Jul-02 20:50
storein28-Jul-02 20:50 
Generalhelp me Pin
Anonymous26-Jul-02 18:28
Anonymous26-Jul-02 18:28 
GeneralRe: help me Pin
Ken Mazaika26-Jul-02 18:33
Ken Mazaika26-Jul-02 18:33 
GeneralRe: help me Pin
perlmunger26-Jul-02 18:44
perlmunger26-Jul-02 18:44 
GeneralRe: help me Pin
Peter Occil26-Jul-02 18:52
Peter Occil26-Jul-02 18:52 

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.