The code we can download does not compile because m_lstCombo.CreateEx() has 7 parameters instead of 5. For this reason I changed the code in this way
then in my program I declared the object in this way:Code:m_lstCombo.CreateEx( 0, dwStyle, rc, this, 0 );
when I doCode:CTooltipComboBox *pCombo = (CTooltipComboBox*)GetDlgItem(IDC_... ); // IDC_... resource ID of my combo
my application crashes. Call stack: m_lstCombo is not inizialized.Code:pCombo->SetItemTip(iCount, strTips);
I searched where m_lstCombo should be created (CTooltipComboBox::PreSubclassWindow()) => put a breakpoint inside it => PreSubclassWindow() is never called.
I tryed to create a public method (CTooltipComboBox::MyPreSubclassWindow()) with the same code of PreSubclassWindow() and I called it after pCombo definition => application crashes in
in particular it crashes here:Code:m_lstCombo.CreateEx( 0, dwStyle, rc, this, 0 );
Code:BOOL CListCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) { // initialize common controls VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_LISTVIEW_REG)); CWnd* pWnd = this; return pWnd->Create(WC_LISTVIEW, NULL, dwStyle, rect, pParentWnd, nID); // here }




Reply With Quote