Search

BUG: MFC - Observation pointer in CMFCRibbonBar becomes invalid by mem64k

Closed
as By Design Help for as By Design

1
0
Sign in
to vote
Type: Bug
ID: 767035
Opened: 10/11/2012 5:20:38 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
There is an observation pointer (m_pPressed) that will be initialized in CMFCRibbonBar::OnLButtonDown() function. This pointer needs to be valid during the live time of the CMFCRibbonPanel elements on the ribbon bar. In case the user removes some or all elements with CMFCRibbonPanel::RemoveAll() or MFCRibbonPanel::Remove() before the mouse interaction is completely ended, the observation pointer becomes invalid and the application crashes.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

- Create a simple ribbon application
- Add Edit control and some buttons to the ribbon panels
- Add OnKillFocus handles the the edit control
- Remove panel elements or replace panel elements with other controls in the OnKillFocus handler
- Run the application, input some value into Edit control and press some button on the panel
- Application will crash or breaks in CMFCRibbonBar::OnLButtonDown() with invalid m_pPressed.

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

English

Actual results

Application crash.

Expected results

No crash.
File Attachments
File Name Submitted By Submitted On File Size  
MFCRibbonPressedTest.zip 10/12/2012 109 KB
Sign in to post a comment.
Posted by Microsoft on 11/2/2012 at 10:08 AM
Hello,

Thanks for the report. We have investigated and believe that this behavior is by design: you should not try to delete the ribbon edit owner inside the message loop. The preferable way to do it is by calling PostMessage with some user message (e.g. UM_CLEANUP_PANEL) from the OnKillFocus message handler and then remove panel elements inside UM_CLEANUP_PANEL message handler.

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 10/15/2012 at 4:02 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by mem64k on 10/12/2012 at 4:03 AM
Hi! I just uploaded a sample project MFCRibbonPressedTest.zip.
Posted by Microsoft on 10/11/2012 at 9:04 PM
Thanks for your feedback.

In order to fix the issue, we must first reproduce the issue in our labs. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project so that we can conduct further research?

Please submit this information to us within 3 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 10/11/2012 at 5:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.