My application consists of a custom tree derived off of MFC CTreeCtrl. I handled the ON_WM_LBUTTONDBLCLK such that when I double click on a particular tree item, it changes to a combobox and ON_CBN_KILLFOCUS will destroy the combobox and reset the tree item.
Double clicking the tree item creates a combobox but left clicking an item after that is resulting in a crash.
I get the following error: Unhandled exception at 0x7e43bb1f in MyTree.exe: 0xC0000005: Access violation reading location 0x000000a4.
It fails at - ::CallWindowProc(m_pfnSuper, m_hWnd, nMsg, wParam, lParam) within LRESULT CWnd::DefWindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam)
I can see that m_hWnd is NULL when it breaks but unable to figure out how to fix it or find the cause.
Any thoughts/suggestions please?
Thanks!