Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CMainFrame::OnSetPreviewMode not being called
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CMainFrame::OnSetPreviewMode not being called

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


Joined: 05 May 2008
Location: United Kingdom
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote whudson Quote  Post ReplyReply Direct Link To This Post Topic: CMainFrame::OnSetPreviewMode not being called
    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?


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.156 seconds.