The CMMALogListBox class is a class for implementing a logbook in an application.
The logbook can be used as a control (CMMALogListBox) or as a dialog which includes the control (CMMALogbookDlg).
Using the CMMALogbookDlg class is very simple to use instead of the control himself.
The logbook file will be automatically created.
Here are some feature of my logbook :
Using the CMMALogListBox Class
To use CMMALogListBox class, you must do the following:
1. In the dialog resource, add a listbox (IDLB_LOGBOOK) and set the
LVS_OWNERDRAWVARIABLE and LVS_SORT flags. And don’t set the LVS_HASSTRING flag.
2. Add in the dialog message handler these lines (the dialog were you use the control) :
if (message == WM_DRAWITEM
&& (UINT)wParam == IDLB_LOGBOOK)
if (message == WM_MEASUREITEM
&& if (UINT)wParam == IDLB_LOGBOOK)
3. Add a membre variable to the dialog like this :
4. In the WM_INITDIALOG message, call the attach function on the control class :
“LOGBOOK.LOG”, MAXLINES, TRUE);
You can peer through the source code to see how to implement the CMMALogListBox class.
Using the CMMALogbookDlg class
For using CMMALogbookDlg class, you must do this :
1. Add a variable :
2. Create the logbook dialog box and show it :
NULL, “LOGBOOK.LOG”, MAXLINES)
3. After using the logbook dialog, you must destroy it :
You can peer through the source code to see how to implement the CMMALogbookDlg class.