Log Book Control


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 :

  • Multilines
  • Colors
  • Fonts
  • Printing

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)
 return TRUE;

if (message == WM_MEASUREITEM 
&& if (UINT)wParam == IDLB_LOGBOOK)
 return TRUE;
3. Add a membre variable to the dialog like this :
CMMALogListBox m_cMMALogListBox;
4. In the WM_INITDIALOG message, call the attach function on the control class :
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 :
CMMALogbookDlg cMMALogbookDlg;
2. Create the logbook dialog box and show it :

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.


Download demo project - 90 Kb
Download source - 17 Kb


  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date