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 » CExtReportGridWnd crash Collapse All
Subject Author Date
David Skok Apr 25, 2007 - 8:11 AM

CExtReportGridWnd will cause an app to crash when its destructor is called under the following conditions:

CExtReportGridColumns are registered, CExtReportGridItems are registered.
NO CExtReportGridColumns are active.

An simple workaround is to make a column active in the destructor. Just letting you know in case others experience it.

Technical Support Apr 26, 2007 - 3:39 AM

Thank you for reporting this problem. You can fix it by updating the following two methods:

LONG CExtTreeGridWnd::ItemRemove(
      HTREEITEM hTreeItem,
      bool bChildrenOnly, // = false
      bool bRedraw // = true
      ) // returns count of removed items
{
      ASSERT_VALID( this );
      if( hTreeItem == NULL )
            return 0;
      ItemFocusSet( NULL, false );
LONG nCountRemoved = (LONG)
            _GetTreeData().TreeNodeRemove(
                  CExtTreeGridCellNode::FromHTREEITEM(hTreeItem),
                  bChildrenOnly
                  );
      if( GetSafeHwnd() != NULL )
      {
            OnSwUpdateScrollBars();
            if( bRedraw )
                  OnSwDoRedraw();
      }
      return nCountRemoved;
}

CExtReportGridWnd::~CExtReportGridWnd()
{
LONG nColCount = ColumnCountGet();
LONG nRowCount = RowCountGet();
      if( nRowCount > 0 )
      {
            if( nColCount > 0 )
            {
                  SelectionUnset( false, false );
                  SelectionInsertAt( 0, CRect( 0, 0, nColCount - 1, nRowCount - 1 ), false );
                  ReportItemUnRegisterSelection( false );
            }
            else
            {
                  HTREEITEM htiRoot = ItemGetRoot();
                  if( htiRoot != NULL )
                        ItemRemove( htiRoot, true, false );
            }
      }
      ReportColumnUnRegister();
}