Click here to Skip to main content
15,917,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Get CMenu Rect? Pin
CPallini10-Aug-10 3:25
mveCPallini10-Aug-10 3:25 
GeneralRe: How to Get CMenu Rect? Pin
dancingfish10-Aug-10 3:30
dancingfish10-Aug-10 3:30 
QuestionRe: How to Get CMenu Rect? Pin
David Crow10-Aug-10 3:32
David Crow10-Aug-10 3:32 
AnswerRe: How to Get CMenu Rect? Pin
dancingfish10-Aug-10 3:39
dancingfish10-Aug-10 3:39 
QuestionRe: How to Get CMenu Rect? Pin
David Crow10-Aug-10 3:46
David Crow10-Aug-10 3:46 
AnswerRe: How to Get CMenu Rect? Pin
dancingfish10-Aug-10 3:47
dancingfish10-Aug-10 3:47 
GeneralRe: How to Get CMenu Rect? Pin
David Crow10-Aug-10 4:11
David Crow10-Aug-10 4:11 
GeneralRe: How to Get CMenu Rect? Pin
Richard MacCutchan10-Aug-10 4:03
mveRichard MacCutchan10-Aug-10 4:03 
AnswerRe: How to Get CMenu Rect? Pin
Eugen Podsypalnikov10-Aug-10 9:41
Eugen Podsypalnikov10-Aug-10 9:41 
GeneralRe: How to Get CMenu Rect? Pin
dancingfish10-Aug-10 14:39
dancingfish10-Aug-10 14:39 
QuestionLogging in VC++ Pin
dilara semerci10-Aug-10 1:57
dilara semerci10-Aug-10 1:57 
AnswerRe: Logging in VC++ Pin
CPallini10-Aug-10 2:57
mveCPallini10-Aug-10 2:57 
AnswerRe: Logging in VC++ Pin
Niklas L10-Aug-10 3:01
Niklas L10-Aug-10 3:01 
AnswerRe: Logging in VC++ Pin
Moak10-Aug-10 4:28
Moak10-Aug-10 4:28 
GeneralRe: Logging in VC++ Pin
dilara semerci10-Aug-10 20:09
dilara semerci10-Aug-10 20:09 
GeneralRe: Logging in VC++ Pin
CPallini10-Aug-10 20:59
mveCPallini10-Aug-10 20:59 
QuestionRe: Logging in VC++ Pin
dilara semerci10-Aug-10 21:02
dilara semerci10-Aug-10 21:02 
AnswerRe: Logging in VC++ Pin
CPallini10-Aug-10 21:11
mveCPallini10-Aug-10 21:11 
AnswerRe: Logging in VC++ Pin
Moak10-Aug-10 23:20
Moak10-Aug-10 23:20 
GeneralRe: Logging in VC++ Pin
PJ Arends10-Aug-10 22:40
professionalPJ Arends10-Aug-10 22:40 
GeneralRe: Logging in VC++ Pin
Moak10-Aug-10 23:01
Moak10-Aug-10 23:01 
dilara semerci wrote:
have a size limit-say 50mb- and keep the newest data but erase the oldest not to exceed this size limit


Sure this is possible. If you want to keep log files under a certain size limit, the algorithm would be similar:

Write to end of log file. If it is over size X (e.g. 50MB), open a new file, seek log file 10% forward, copy the remaining log file, swap files (remove, rename), reopen new file. The reason why I suggested to skip 10% forward, is so that you don't have to to this operation every time. The application can fill the log file, it will be decreased in size from time to time, then it can fill it up again.

As an alternative to a single log file, use multiple files: Check if writing to end of log file will be over size X, if not write to end of file and if yes open a new file under a new name (overwrite if it exists) and continue logging there. The idea is to have multiple files to write to, e.g. logfile1.txt logfile2.txt logfile3.txt ... if you filled logfile3.txt you can start over with logfile1.txt again. Size of individual log file = total logging size X / number of files. Not very common, but possible.

Does this help? Smile | :)
/M

QuestionCRichEditCtrrl and EN_REQUESTRESIZE [modified] Pin
Leif Goodwin10-Aug-10 1:50
Leif Goodwin10-Aug-10 1:50 
QuestionCRectTracker on CScrollView Pin
mesajflaviu10-Aug-10 1:39
mesajflaviu10-Aug-10 1:39 
AnswerRe: CRectTracker on CScrollView [Repost] Pin
Richard MacCutchan10-Aug-10 1:42
mveRichard MacCutchan10-Aug-10 1:42 
AnswerRe: CRectTracker on CScrollView Pin
Niklas L10-Aug-10 1:44
Niklas L10-Aug-10 1:44 

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.