Print Page | Close Window

Rapid clicks on a combo-box column cause a crash.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23890
Printed Date: 28 March 2024 at 8:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Rapid clicks on a combo-box column cause a crash.
Posted By: yuhong155
Subject: Rapid clicks on a combo-box column cause a crash.
Date Posted: 14 August 2019 at 1:10pm


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,





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net