// TwoPaneList.cpp : implementation file // #include "stdafx.h" #include "twoPane.h" #include "TwoPaneList.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTwoPaneList CTwoPaneList::CTwoPaneList() { } CTwoPaneList::~CTwoPaneList() { } IMPLEMENT_DYNCREATE(CTwoPaneList, CListView) BEGIN_MESSAGE_MAP(CTwoPaneList, CListView) //{{AFX_MSG_MAP(CTwoPaneList) ON_WM_CREATE() ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTwoPaneList message handlers int CTwoPaneList::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CListView::OnCreate(lpCreateStruct) == -1) return -1; ModifyStyle(LVS_TYPEMASK, LVS_LIST); GetListCtrl().InsertColumn(0,_T("title"),LVCFMT_LEFT,300); CListCtrl& cl = GetListCtrl(); int nItem = cl.GetItemCount(); // put new title at end of list cl.InsertItem(nItem,(LPCTSTR)_T("first item in list")); nItem = cl.GetItemCount(); // put new title at end of list cl.InsertItem(nItem,(LPCTSTR)_T("second item in list")); nItem = cl.GetItemCount(); // put new title at end of list cl.InsertItem(nItem,(LPCTSTR)_T("third item in list")); return 0; }