Article ID: 956003 - View products that this article applies to.
RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
Note: This article applies to the Visual C++ 2008 Feature Pack
The application shows a debug assertion on f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxribbonbar.cpp, Line: 3891
The following function shows the assertion:
// This line shows the assertion
During the initialization of ribbon bar control, the application calls SetQuickAccessDefaultState() to set the Quick Access Toolbar. Inside this function, the ribbon bar tries to recalculate its layout by calling RecalcLayout() function. This function internally checks if printing is supported by the class, then it adds it to the Print Preview Category. While adding it to this category, the application tries to load a printing string resource with ID AFX_IDS_ONEPAGE. Since this resource ID is not part of the application instance, loading it shows an debug assertion.
Disable the Print Preview for Ribbon Bar. This can be done using CMFCRibbonBar::EnablePrintPreview function.
This is a know bug with the wizard-generated code. CFormView classes do not have printing support. After creating the project, the wizard does prompt the message “No printing support will be available for CFormView”, but it fails to generate correct code for ribbon bar for disabling the printing.
Making the following change allows it to work.
// Disable the Print Preview for Ribbon Bar
As the application links statically to MFC, the ID will not be available in the application instance. All standard MFC resources are selectively built or not built into your module, based on wizard selections. For dynamic link they are always part of the MFC80[u][d].dll.
MFC Hierarchy Chart
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Article ID: 956003 - Last Review: July 21, 2008 - Revision: 1.0
Contact us for more help
Connect with Answer Desk for expert help.