Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Drive Names - Please reply Pin
David Crow6-Sep-06 4:11
David Crow6-Sep-06 4:11 
AnswerRe: Drive Names - Please reply Pin
Hamid_RT6-Sep-06 4:27
Hamid_RT6-Sep-06 4:27 
GeneralRe: Drive Names - Please reply Pin
David Crow6-Sep-06 6:23
David Crow6-Sep-06 6:23 
GeneralRe: Drive Names - Please reply Pin
David Crow6-Sep-06 4:26
David Crow6-Sep-06 4:26 
QuestionCFile Data Removal Pin
payal3355-Sep-06 22:27
payal3355-Sep-06 22:27 
AnswerRe: CFile Data Removal Pin
ThatsAlok5-Sep-06 22:35
ThatsAlok5-Sep-06 22:35 
AnswerRe: CFile Data Removal Pin
Nibu babu thomas5-Sep-06 22:58
Nibu babu thomas5-Sep-06 22:58 
AnswerRe: CFile Data Removal Pin
Viorel.5-Sep-06 23:07
Viorel.5-Sep-06 23:07 
Unfortunately, it seems the Operating System does not allow shortening of a file by removing data at the beginning. It only allows truncation of the tail. Therefore I think it is not possible to solve your problem without read and write operations (on the same or two files).

But I would consider the following approach. The first value of your file should be reserved: it will contain the position of the first line that should be read. After you read your 200 lines, simply rewrite the first value. These lines are still in the file, but are ignored on next operations.

So you have to deal with GetPosition and Seek members of CFile.

Instead of storing the position in the same file, you can store it in a separate file or in memory.

This way the file will grow when you append new lines, therefore you should really remove unneeded head lines periodically.

I hope this helps.
GeneralRe: CFile Data Removal Pin
payal3355-Sep-06 23:15
payal3355-Sep-06 23:15 
QuestionFlex Gird & Chart in VC++ Pin
victorsarathy5-Sep-06 20:55
victorsarathy5-Sep-06 20:55 
AnswerRe: Flex Gird & Chart in VC++ Pin
ThatsAlok5-Sep-06 22:38
ThatsAlok5-Sep-06 22:38 
QuestionLDAP Memory Issue Pin
Dribble5-Sep-06 20:49
Dribble5-Sep-06 20:49 
AnswerRe: LDAP Memory Issue Pin
Waldermort6-Sep-06 0:45
Waldermort6-Sep-06 0:45 
QuestionHow to suppress reboot while installing MSI package Pin
LiYS5-Sep-06 20:48
LiYS5-Sep-06 20:48 
AnswerRe: How to suppress reboot while installing MSI package Pin
LiYS5-Sep-06 22:42
LiYS5-Sep-06 22:42 
Questionerror Pin
With_problem5-Sep-06 20:34
With_problem5-Sep-06 20:34 
AnswerRe: error Pin
Cedric Moonen5-Sep-06 20:38
Cedric Moonen5-Sep-06 20:38 
AnswerRe: error Pin
Hamid_RT5-Sep-06 20:39
Hamid_RT5-Sep-06 20:39 
AnswerRe: error Pin
Hamid_RT5-Sep-06 20:44
Hamid_RT5-Sep-06 20:44 
GeneralRe: error Pin
With_problem5-Sep-06 20:57
With_problem5-Sep-06 20:57 
AnswerRe: error Pin
Trollslayer5-Sep-06 22:55
mentorTrollslayer5-Sep-06 22:55 
Questionabout multi threading in visual C++ Pin
mt_samiei5-Sep-06 20:16
mt_samiei5-Sep-06 20:16 
AnswerRe: about multi threading in visual C++ Pin
Cedric Moonen5-Sep-06 20:35
Cedric Moonen5-Sep-06 20:35 
GeneralRe: about multi threading in visual C++ Pin
mt_samiei5-Sep-06 21:33
mt_samiei5-Sep-06 21:33 
AnswerRe: about multi threading in visual C++ Pin
Viorel.5-Sep-06 20:50
Viorel.5-Sep-06 20:50 

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.