Click here to Skip to main content
15,904,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Chris Meech29-Jul-03 8:32
Chris Meech29-Jul-03 8:32 
GeneralRe: Subclassing CListCtrl in a CListView Pin
#realJSOP29-Jul-03 8:51
professional#realJSOP29-Jul-03 8:51 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer29-Jul-03 10:26
Tom Archer29-Jul-03 10:26 
GeneralRe: Subclassing CListCtrl in a CListView Pin
#realJSOP30-Jul-03 3:07
professional#realJSOP30-Jul-03 3:07 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer29-Jul-03 10:28
Tom Archer29-Jul-03 10:28 
GeneralRe: Subclassing CListCtrl in a CListView Pin
#realJSOP30-Jul-03 3:08
professional#realJSOP30-Jul-03 3:08 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 3:39
Tom Archer30-Jul-03 3:39 
GeneralRe: Subclassing CListCtrl in a CListView Pin
#realJSOP30-Jul-03 4:29
professional#realJSOP30-Jul-03 4:29 
I think I need to start this again. The desktop app (legacy code, not coded by me) does this:

A CView-derived class that contains a data member that is defines as follows:

protected:<br />
   CMyListCtrl< CDataObject > myListCtrl;<br />


A CListCtrl-derived class implemented like so:

<br />
template < class T > class CMyListCtrl : public CListCtrl<br />
{<br />
blah blah blah<br />
};<br />


The list control class cannot be changed because it's used in several other places (other views and dialogs as well).

I am probably mistaken, but this arrangement doesn't appear to me to be usable as far as deriving new view classes. Would it be valid to do this:

typedef CMyListCtrl< CDataObject > CMyDataObjectListCtrl;<br />


and then use the new typedef as a basis for using your CCtrlView article (cited by someone else)?

<br />
CMyListView::CMyListView():CCtrlView(_T("MYLISTCTRL"), AFX_WS_DEFAULT_VIEW) { };<br />
<br />
CMyDataObjectListCtrl& CMyListView::GetListBox() const <br />
{ return *(CMyDataObjectListCtrl*)this; }<br />




------- signature starts

"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

"You won't like me when I'm angry..." - Dr. Bruce Banner

Please review the Legal Disclaimer in my bio.

------- signature ends
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 5:11
Tom Archer30-Jul-03 5:11 
GeneralRe: Subclassing CListCtrl in a CListView Pin
#realJSOP30-Jul-03 5:56
professional#realJSOP30-Jul-03 5:56 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 6:01
Tom Archer30-Jul-03 6:01 
GeneralRe: Subclassing CListCtrl in a CListView Pin
#realJSOP30-Jul-03 6:48
professional#realJSOP30-Jul-03 6:48 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 6:50
Tom Archer30-Jul-03 6:50 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer29-Jul-03 10:22
Tom Archer29-Jul-03 10:22 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Nick Parker29-Jul-03 17:41
protectorNick Parker29-Jul-03 17:41 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer29-Jul-03 18:21
Tom Archer29-Jul-03 18:21 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Nick Parker29-Jul-03 18:56
protectorNick Parker29-Jul-03 18:56 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 3:36
Tom Archer30-Jul-03 3:36 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Michael Dunn29-Jul-03 16:57
sitebuilderMichael Dunn29-Jul-03 16:57 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer29-Jul-03 18:23
Tom Archer29-Jul-03 18:23 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 9:45
Tom Archer30-Jul-03 9:45 
GeneralVC++6 ide question Pin
Beer2629-Jul-03 6:57
Beer2629-Jul-03 6:57 
GeneralRe: VC++6 ide question Pin
David Crow29-Jul-03 7:25
David Crow29-Jul-03 7:25 
GeneralRe: VC++6 ide question Pin
Beer2629-Jul-03 8:43
Beer2629-Jul-03 8:43 
GeneralRe: VC++6 ide question Pin
Mike Dimmick29-Jul-03 13:29
Mike Dimmick29-Jul-03 13:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.