Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CListCtrl Selection problem Pin
Mark Salsbery11-Feb-07 11:19
Mark Salsbery11-Feb-07 11:19 
GeneralRe: CListCtrl Selection problem Pin
Zombie_Inc11-Feb-07 11:32
Zombie_Inc11-Feb-07 11:32 
GeneralRe: CListCtrl Selection problem Pin
Mark Salsbery11-Feb-07 11:35
Mark Salsbery11-Feb-07 11:35 
GeneralRe: CListCtrl Selection problem Pin
Mark Salsbery11-Feb-07 11:50
Mark Salsbery11-Feb-07 11:50 
QuestionLog file structures Pin
Waldermort11-Feb-07 8:46
Waldermort11-Feb-07 8:46 
AnswerRe: Log file structures Pin
Mark Salsbery11-Feb-07 9:21
Mark Salsbery11-Feb-07 9:21 
GeneralRe: Log file structures Pin
Waldermort11-Feb-07 9:40
Waldermort11-Feb-07 9:40 
GeneralRe: Log file structures Pin
Mark Salsbery11-Feb-07 10:28
Mark Salsbery11-Feb-07 10:28 
WalderMort wrote:
The only trouble is dealing with the items when the file reaches it's max size. Obviously the oldest entries should be removed,


D'Oh! | :doh: Yeah. A linked list allows for variable size entries no problem (each entry just needs
a little header of some kind (with at least a next_offset field and a length field).

Whether you use a table (like FAT) or a linked list you still end up with fragmented file image
(little holes of free space) when removing oldest etries since there's two types of entries.
You'll have to periodically defrag anyway so a table would be much more efficient then walking
a chain of offsets every time.

I guess each entry in a FAT_style table could represent a 256-byte area of the log file.
Each entry only needs to be a WORD, with perhaps 0 indicating free, 0xFFFF indicating the last
entry in a chain of entries, and any other value indicates the index of the next entry in the
chain.

Reserve entries at index 0 and 1 for "directories" (one for each of the two types of log
entries). In the directories keep structs for each log entry - each struct has a timestamp and
an index into the "FAT" table of the first 256-byte "sector" of the entry. The directories can
grow as necessary since they are just linked chains in the "FAT" table. Of course, directory
entries need a way to be marked as free as well.

That's pretty similar to the FAT system if I remember right Smile | :)
Thank goodness for random access files!
GeneralRe: Log file structures Pin
Waldermort11-Feb-07 20:40
Waldermort11-Feb-07 20:40 
GeneralRe: Log file structures Pin
kakan12-Feb-07 1:17
professionalkakan12-Feb-07 1:17 
GeneralRe: Log file structures Pin
Waldermort12-Feb-07 2:00
Waldermort12-Feb-07 2:00 
GeneralRe: Log file structures Pin
kakan12-Feb-07 2:04
professionalkakan12-Feb-07 2:04 
QuestionCreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 3:59
Jeffrey Walton11-Feb-07 3:59 
AnswerRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Waldermort11-Feb-07 4:06
Waldermort11-Feb-07 4:06 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 10:06
Jeffrey Walton11-Feb-07 10:06 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 10:13
Jeffrey Walton11-Feb-07 10:13 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Waldermort11-Feb-07 20:27
Waldermort11-Feb-07 20:27 
AnswerRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Jeffrey Walton11-Feb-07 10:09
Jeffrey Walton11-Feb-07 10:09 
GeneralRe: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED) Pin
Mark Salsbery11-Feb-07 10:41
Mark Salsbery11-Feb-07 10:41 
QuestionWeb service in the MFC, who can answer??????? Pin
Tarek Jabri11-Feb-07 2:39
Tarek Jabri11-Feb-07 2:39 
AnswerRe: Web service in the MFC, who can answer??????? Pin
Christian Graus11-Feb-07 11:43
protectorChristian Graus11-Feb-07 11:43 
QuestionXML Packet Pin
Member 292037811-Feb-07 2:37
Member 292037811-Feb-07 2:37 
AnswerRe: XML Packet Pin
Hamid_RT12-Feb-07 6:46
Hamid_RT12-Feb-07 6:46 
QuestionUML drawings of class diagrams for a general dialog based GUI application Pin
dtraj110-Feb-07 21:20
dtraj110-Feb-07 21:20 
QuestionPlease Clarify. Pin
ashwath197910-Feb-07 19:45
ashwath197910-Feb-07 19:45 

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.