Re: deriving from CListCtrl



Where are you making that call from? Is it before or after your dialogs
CDialog::OnInitDialog call?

Make sure it is after the call to OnInitDialog

AliR.


"Sticky0002" <Sticky0002@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:12176379-A301-4377-AF83-2EAC7CDC6D89@xxxxxxxxxxxxxxxx
I'm trying to get two different subclasses to work together. I'm doing
this
within a child dialog of a MFC dialog App.

My Current subclass (or derived class) is on CListCtrl Control.

My calss is called CSortListCtrl Decalred with the variable m_cList2Ctrl.

The other class i'm trying to integrate into CSortListCtrl is Called
CHeaderCtrlEX declared m_HeaderCtrl.

I call a function to act like a Oninit to setup the list control.

When i didn't have the new subclass in.(CSortListCtrl) The code below for
the CHeaderCtrlEX would work. But now it wont.

CHeaderCtrl* pHeader = NULL;
pHeader=m_Clist2Ctrl.GetHeaderCtrl();

If(pHeader==NULL)
return;
m_HeaderCtrl.SubclassWindow(pHeader->m_hWnd); // <-- This is where the
code fails. It looks like according to debug it can't get a hWnd.

I've tried many different ways to work around this and i have come up dry.
Any help would be Greatly Appreciated.


.