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

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 767035 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 10/11/2012 5:20:38 AM
Access Restriction Public


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.
Sign in to post a comment.
Posted by Microsoft on 11/2/2012 at 10:08 AM

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)