Why CListView do not inherit from CListCtrl
-
I wrote some useful code in my class
Class CMyListCtrl:public CListCtrl
And now,I want to use these code in my new class CMyListView. Originally,I want to inherit CMyListView from CMyListCtrl. But I found that ListView do not inherit from ListCtrl. So how can I use my own code for CMyListView with less modification! Thanks a lot! Don't look at me in that way! -
I wrote some useful code in my class
Class CMyListCtrl:public CListCtrl
And now,I want to use these code in my new class CMyListView. Originally,I want to inherit CMyListView from CMyListCtrl. But I found that ListView do not inherit from ListCtrl. So how can I use my own code for CMyListView with less modification! Thanks a lot! Don't look at me in that way!CListView inherites from CCtrlView and eventually from CView in order to keep the documnet/view architecture whilst using a list view within your app.... in order to use your CMyListCtrl in a CListView i suggest embedding...i.e. embedd one in an other class CMyListView : public CView { protected: CMyListCtrl* m_pMyList; } hope this helps Yaron Ask not what your application can do for you, Ask what you can do for your application
-
I wrote some useful code in my class
Class CMyListCtrl:public CListCtrl
And now,I want to use these code in my new class CMyListView. Originally,I want to inherit CMyListView from CMyListCtrl. But I found that ListView do not inherit from ListCtrl. So how can I use my own code for CMyListView with less modification! Thanks a lot! Don't look at me in that way!you can use templates. See the source of CHTMLEditView and CHTMLEditCtrl. My blogs: http://blog.joycode.com/jiangsheng http://blog.csdn.net/jiangsheng http://bloglines.com/public/jiangsheng Command what is yours Conquer what is not ---Kane -- modified at 1:24 Tuesday 15th November, 2005