Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Crash in CExtTreeGridCellNode::FromHTREEITEM - Need solutioin ASAP! Collapse All
Subject Author Date
Offer Har May 12, 2009 - 12:01 PM

Dear Support,


We have the following scenario in an CExtTreeGrid :


1. Add two nodes to a tree under root


2. Add a third node to the tree


3. Move the first two nodes under the third node using ItemCopyMove.


4. Try to call CExtTreeGridCellNode::ItemGetChildCount on the first two nodes - CRASH!, the crash is in CExtTreeGridCellNode::FromHTREEITEM, in the line:



    ASSERT_KINDOF( CExtTreeGridCellNode, pCell );


I am sending you now an application to reproduce this bug.


Please attent to it as soon as possible, because we need it urgently! The same code worked fine under 2.83


Thanks,


Ron.

Technical Support May 14, 2009 - 12:46 PM

There are no problems with Prof-UIS. The CExtTreeGridWnd::ItemCopyMove() method inserts cloned copies of tree rows or even tree branches. So, the CComboProblemDlg::OnClick3() method in the test project you sent us should renew the item handles:

void CComboProblemDlg::OnClick3()
{
      m_tree.ItemCopyMove(m_tree.m_htItem1, m_tree.m_htParent, (ULONG(-1L)), true, true, TVE_TOGGLE, true, false);
      m_tree.ItemCopyMove(m_tree.m_htItem2, m_tree.m_htParent, (ULONG(-1L)), true, true, TVE_TOGGLE, true, false);

      m_tree.m_htItem1 = m_tree.ItemGetChildAt( m_tree.m_htParent, 0L ); // renew HTREEITEM handle
      m_tree.m_htItem2 = m_tree.ItemGetChildAt( m_tree.m_htParent, 1L ); // renew HTREEITEM handle

      m_tree.OnSwUpdateScrollBars();
      m_tree.OnSwDoRedraw();
}