Re: Experts pls !!! problem in Adding items to a subclassed CListCtrl class
I am not sure, things look fine here.
When you get the assert, press retry. Write down the filename and line
number. (Post it here)
Also follow the call stack back to your own code, and make sure that it is
really from InsertItem.
AliR.
<nicetom786@yahoo.com> wrote in message
news:1147364082.989532.243540@i39g2000cwa.googlegroups.com...
Thanks for quick response and it worked.
Now When I am adding columsns it worked .
But When I add items I get a debug assertion? Why ??
Pls guide
here is teh code in oninitial update of CFormView
void CMichaelChaseView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
CString buffer = "Item1";
// ResizeParentToFit();
m_myListCtrl.InsertColumn(0, "Column 1");
m_myListCtrl.InsertColumn(1, "Column 2");
m_myListCtrl.InsertColumn(2, "Column 3");
m_myListCtrl.SetColumnWidth(0, 100);
m_myListCtrl.SetColumnWidth(1, 100);
m_myListCtrl.SetColumnWidth(2, 100);
for(int i=0;i<3;i++)
{
m_myListCtrl.InsertItem(i,(LPCTSTR)buffer);
m_myListCtrl.SetItemText(i,1,(LPCTSTR)buffer);
}