We encountered an access violation crash when one clicks on the combo-button column (onto the cells not on the arrows) rapidly. Each column in our sheet is a CXTPReportColumn type and they are held by a CXTPReportColumns object. Given the fact that this piece code is relatively old (5 years old), the workflow was not very ideal. Every time a different cell is clicked on, the selection-changed event handler would try to refresh styles (visibility, editability, etc ...) for all columns (we have 26 columns). Please see the following pseudo code:
OnCellSelectionChanged() { ... ... CXTPReportColumns* allColumns = ... ... ...
for (int i = 0; i < numberOfColumns; i++) { CXTPReportColumn* pColumn = allColumns->GetAt(i); ... ...
// for the combo button column case: CXTPReportRecordItemEditOptions* editOptions = pColumn->GetEditOptions(); editOptions->RemoveButtons(); editOptions->m_bAllowEdit = TRUE; editOptions->m_bConstraintEdit = TRUE; editOptions->AddComboButton(TRUE); editOptions->m_bSelectTextOnEdit = FALSE;
... ... } ... ... }
The CodeJock version used in our application is 17.0.0. It is not likely for us to update it to a new version. We did some experiments and found out that if the line calling the AddComboButton(TRUE) is removed, then the crash is gone. We tried to put a static bool that remembers if one event handler is currently running so that when another event comes in, it will just do an early return. However, this doesn't fix it. Could someone please shed some light on this? Thank you.
Here is the call stack at crash,
|