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 » Inserting a large number of rows in CExtReportGridWnd Collapse All
Subject Author Date
Eric Houvenaghel Nov 8, 2007 - 12:57 PM

I am getting a crash when a large number of rows are inserted into the CExtReportGridWnd.
The crash happens when the following line of code fails (line 11195 in ExtGridWnd.cpp):

    LPBYTE pMemoryNew = (LPBYTE)::realloc( pMemory, size_t(nSize)+sizeof(_CRT_header_chunk_t) );

realloc returns NULL.
I tested the grid with 20 columns, 35000 rows and CExtGridCellComboBox each containing 4 "Hello World" strings.
This takes up a very large amount of memory ~756MB!!!
Seems like alot but that’s what it says in Task Manager.
The funny thing is if I replace the CExtGridCellComboBox for CExtGridCellStringDM I can go past the 756MB range and, although not very usuable, the application does not crash.
The crash really seems to be linked to the insertion of items in CExtGridCellComboBox.
The crash does not happen if the CExtGridCellComboBox does not contain items.
Last but not least, I think the crash could be avoided by putting an if statement on line 1011 in ExtTreeGridWnd.cpp.

    _DP.RowInsert( nInsertOffset, nInsertCount );
to
    if(_DP.RowInsert( nInsertOffset, nInsertCount )) {

        return NULL;
    }

Cheers

Technical Support Nov 13, 2007 - 2:46 AM

Yes, grouping is not available in virtual mode because the grid must keep the entire data before re-grouping it.

Technical Support Nov 9, 2007 - 10:49 AM

We confirm that the following line in the CExtTreeGridDataProvider::_Tree_NodeInsert() method in the ../Prof-UIS/Src/ExtTreeGridWnd.cpp file:

      _DP.RowInsert( nInsertOffset, nInsertCount );
should be replaced with
      if( ! _DP.RowInsert( nInsertOffset, nInsertCount ) )
            return NULL;
The CExtGridCellComboBox class is convenient but not memory efficient. Each instance of this class contains its own only collection of strings to be displayed in the pop-up list box. It’s not efficient to instantiate a lot of such combo box cells with exactly the same content. Besides this class is based on CExtGridCellString, which is a simple text cell based on CString. The CExtGridCellStringDM class is a text cell which keeps text inside an internal memory manager of the grid’s data provider which makes it more memory efficient and faster. But in any case, if you need to show thousands or millions of rows in some grid, then we would recommended to make it virtually cacheable. The report grid control can be only memory based.

Eric Houvenaghel Nov 12, 2007 - 9:58 AM

Thanks for the reply.
I have derived a class from CExtGridCellComboBox.
This class will load the combo items only when the drop list button is clicked.
That reduces the memory usuage greatly.
We have looked into the virtual mode before.
However, the feature that interests us is the grouping feature.
From what I understand, one cannot have the grouping feature in virtual mode.