n***@yahoo.com
2006-05-11 15:17:15 UTC
Hi,
I am adding item to a subclassed class of CListCtrl. What is teh
correct place to add items in subclassed CListCtrl Class .
I did the folowing steps.Pls let me know where I am goin wrong.
1.In a MFC Doc view with Form view,dragged the CList Control in the
view.
2.Created a class from the class wizard MyListtrlwith base class
CListCtrl.
3.Add a message handler for OnLButtonDown for MyListtrl and added a
Message Box
4.Then in resource view selected teh clistcrl and add memebr variable
and this time selected MyListtrl and named it m_myListCtrl;
5.When I executed the app,I get message caught in the derived
class.Thats fine.
Now I need to add items in this control,Where should I add???
CMyListCtrl::CMyListCtrl()
{
//Set the column name
InsertColumn(1,"H2",LVCFMT_LEFT,100);
//Add items here
}
I addded in MyListtrl CONSTRUCTOR BUT got an debug assertion failed
WITH AFXCM.INL line 186.
Where shoudl I add the items so that it can be seen .I also tried in
adding Create handler of MyListtrl .
When I click right button then my derived class message is getting
called .
Pls guide.
Thanks in advance
I am adding item to a subclassed class of CListCtrl. What is teh
correct place to add items in subclassed CListCtrl Class .
I did the folowing steps.Pls let me know where I am goin wrong.
1.In a MFC Doc view with Form view,dragged the CList Control in the
view.
2.Created a class from the class wizard MyListtrlwith base class
CListCtrl.
3.Add a message handler for OnLButtonDown for MyListtrl and added a
Message Box
4.Then in resource view selected teh clistcrl and add memebr variable
and this time selected MyListtrl and named it m_myListCtrl;
5.When I executed the app,I get message caught in the derived
class.Thats fine.
Now I need to add items in this control,Where should I add???
CMyListCtrl::CMyListCtrl()
{
//Set the column name
InsertColumn(1,"H2",LVCFMT_LEFT,100);
//Add items here
}
I addded in MyListtrl CONSTRUCTOR BUT got an debug assertion failed
WITH AFXCM.INL line 186.
Where shoudl I add the items so that it can be seen .I also tried in
adding Create handler of MyListtrl .
When I click right button then my derived class message is getting
called .
Pls guide.
Thanks in advance