Subclassed MFC CHeaderCtrl does only receive WM_NOTIFY in Debug
-
Hi, (1) I have a CRszListCtrl : public CListCtrl (2) which has a CustHeaderCtrl m_hdrCustom, where CustHeaderCtrl : public CHeaderCtrl (3) CRszListCtrl has init() called from CDialog::OnInitDialog. (4) This init() calls void CustHeaderCtrl::init(CListCtrl * const pList) with Argument this (i.e. self) to init its m_hdrCustom (5) The code is
void CustHeaderCtrl::init(CListCtrl * const pList) { m_pParentList = pList; CHeaderCtrl * pHeader = m_pParentList->GetHeaderCtrl(); ASSERT( SubclassWindow(pHeader->GetSafeHwnd()) ); }
(6) To catch clicks on the header items I made handlers for WM_NOTIFY messages resent to the header by it's parent list which where routed via WM_NOTIFY_REFLECT macro or alternatively via OnChildNotify. :(Both work fine but only in debug code! Who can give a solution? Thank you! regards Werner -
Hi, (1) I have a CRszListCtrl : public CListCtrl (2) which has a CustHeaderCtrl m_hdrCustom, where CustHeaderCtrl : public CHeaderCtrl (3) CRszListCtrl has init() called from CDialog::OnInitDialog. (4) This init() calls void CustHeaderCtrl::init(CListCtrl * const pList) with Argument this (i.e. self) to init its m_hdrCustom (5) The code is
void CustHeaderCtrl::init(CListCtrl * const pList) { m_pParentList = pList; CHeaderCtrl * pHeader = m_pParentList->GetHeaderCtrl(); ASSERT( SubclassWindow(pHeader->GetSafeHwnd()) ); }
(6) To catch clicks on the header items I made handlers for WM_NOTIFY messages resent to the header by it's parent list which where routed via WM_NOTIFY_REFLECT macro or alternatively via OnChildNotify. :(Both work fine but only in debug code! Who can give a solution? Thank you! regards Werner -
WernerP wrote:
Both work fine but only in debug code!
Check what you have put in ASSERT macros, do not forget these are not compiled in Release mode. ~RaGE();