void CListView::OnInitialUpdate() { CListView::OnInitialUpdate(); // TODO: You may populate your ListView with items by directly accessing // its list control through a call to GetListCtrl(). // Add the parent item GetListCtrl().InsertColumn(0, _T("Column Text"), LVCFMT_LEFT, 200); GetListCtrl().SetImageList(&m_ImageSmall, LVSIL_SMALL); GetListCtrl().SetImageList(&m_ImageLarge, LVSIL_NORMAL); // Add children for( int i = 1; i < 5; i++ ) { GetListCtrl().InsertItem (0, _T("Child of Parent Item")); } CHeaderCtrl hc; if (hc.IsKindOf(RUNTIME_CLASS(CHeaderCtrl))) { int i = 0;//ok } if (GetListCtrl().GetHeaderCtrl()->IsKindOf(RUNTIME_CLASS(CHeaderCtrl))) { //fail to step in, why? HWND hWndHeader = GetListCtrl().GetDlgItem(0)->GetSafeHwnd(); m_flatHeader.SubclassWindow (hWndHeader); } }
GetListCtrl().GetHeaderCtrl()->IsKindOf(RUNTIME_CLASS(CHeaderCtrl))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)