Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Rapid clicks on a combo-box column cause a crash.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
yuhong155 View Drop Down
Newbie
Newbie


Joined: 14 August 2019
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote yuhong155 Quote  Post ReplyReply Direct Link To This Post Topic: Rapid clicks on a combo-box column cause a crash.
    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,


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.