Re: CListView not inserting items
On 10 Sep 2006 18:14:04 -0700, "MK" <michaelkatsilis@yahoo.com> wrote
in <1157937243.893810.81420@e3g2000cwe.googlegroups.com>:
I
cannot get the list view to show any values other than the column
headings.
[snip]
int CefsmView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListView::OnCreate(lpCreateStruct) == -1)
return -1;
// Setup the columns
CHeaderCtrl * hc = mobjListCtrl.GetHeaderCtrl();
This isn't related, but why are you getting the header control instead
of just using CListCtrl::InsertColumn()?
void CefsmView::Populate(const CString & sItemName)
{
// sItemName is being passed into the method ok
Reset();
You just deleted all of the columns that you so carefully inserted via
Cefsm::OnCreate(). If you have no columns, no items will be
displayed. Check your Reset function:
[snip]
void CefsmView::Reset(void)
{
mobjListCtrl.DeleteAllItems();
while(objListCtrl.DeleteColumn(0));
UpdateWindow();
}
Why are you deleting the columns?
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research