Print Page | Close Window

CMainFrame::OnSetPreviewMode not being called

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=19078
Printed Date: 18 June 2025 at 9:09pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CMainFrame::OnSetPreviewMode not being called
Posted By: whudson
Subject: CMainFrame::OnSetPreviewMode not being called
Date Posted: 18 October 2011 at 6:52am
In a couple of the ToolkitPro (V15.1.3) examples I've looked at that implement Print Preview, the hiding of toolbars/ribbons is not being done. It appears that CMainFrame::OnSetPreviewMode is not being called. 

The view in the Codejock samples (RibbonMDISample and PrintPreview) is handling the print preview command and calling CView::DoPrintPreview, but the expected callback to CMainFrame::OnSetPreviewMode just doesn't happen. The MFC implementation of DoPrintPreview downcasts the main window to a CFrameWnd and then calls OnSetPreviewMode, but this ends up in the CFrameWnd::OnSetPreviewMode implementation even though OnSetPreviewMode is overridden in the CMainFrame class (which uses CXTPMDIFrameWnd as its base class).

I am trying to implement this correctly in my own app. All that comes to mind is to hide the ribbons in the view before calling DoPrintPreview. Any other suggestions how to make it work correctly?





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