Print Page | Close Window

print preview issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8467
Printed Date: 02 March 2025 at 5:06pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: print preview issue
Posted By: Pearl
Subject: print preview issue
Date Posted: 18 October 2007 at 4:25pm
Hi
 
I got print preview issue when I try to use codejock to reskin my MFC 6.0 application. When I click Print Preview, the print preview page looks wierd like the following. I wonder how can I hide the command bar at this moment and still enable the commandbar after I close the print preview. Actually I check the codejock samples, when I click print preview, it did hide the commandbar on the mainframe, in the code it only called CView::OnFilePrintPreview, which is the same as I did, I can't see any special processing on the commandbar though. Thanks for your help! Pearl
 
 
 
 



Replies:
Posted By: Oleg
Date Posted: 19 October 2007 at 12:44am
Hi,
 
Check may be you override CMainFrame::OnSetPreviewMode method and don't call base CXTPFrameWnd method.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Pearl
Date Posted: 19 October 2007 at 12:42pm
i, I check the code, actually OnSetPreviewMode  wasn't being overwrited, and CXTPFrameWnd wasn't applied either. Could you please inform me what I will check next step? Thanks a lot for your help!
 
Pearl
 


Posted By: Oleg
Date Posted: 19 October 2007 at 3:17pm
I see you have standard File and Help menus. so obviously you do something wrong in your code. Copy code from our samples to make it work same.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Pearl
Date Posted: 19 October 2007 at 4:17pm
Ok, let me clarify my problems. I do have a customized IDR_PRINTPREVIEW menu in the resource, once PrintPreview clicked, that menu will automatically appeared on the top of the printPreiew page. The thing is even when I remove that menu from the resource, that menu is not there but the commandbar is still there. Therefor, my first question is how can I hide that commandbar on the PrintPreview page, and the second question is that actually I do need a customized IDR_PRINTPREVIEW menu on the top of the PrintPreview page, from your codejock samples there are no any menus on the PrintPreview page, so I don't know how to add one there?
 
Thanks for your help
 
Pearl


Posted By: Oleg
Date Posted: 20 October 2007 at 2:09am
Hi,
 
Send to mailto:support@codejock.com - support@codejock.com sample to show what you do. I have no idea what you do, so can't suggest how to fix it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Pearl
Date Posted: 22 October 2007 at 1:16pm
Hi, thanks for your patience. I have to say sorry that I made a mistake when I was checking the code for OnSetPreviewMode. There do have an overwitre OnSetPreviewMode in the code. It is attached as the following:
 
void CMainFrame::OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState)
{
 AfxSetResourceHandle( AfxGetInstanceHandle() );
 CMDIFrameWnd::OnSetPreviewMode(bPreview, pState);
  if (bPreview) {
  CMenu preview_menu;
  preview_menu.LoadMenu( MAKEINTRESOURCE( IDR_PRINTPREVIEW) );
    SetMenu(&preview_menu);
    m_hAccelTable = NULL;
    LoadAccelTable(MAKEINTRESOURCE(IDR_PRINT_PREVIEW_ACCEL));
  }
}
 
Right, if I comment out this one, the commandbar will disappear on PrintPreview page. However, the problem is I do need to overwite OnSetPreviewMode(), because originally Print Preview page has a customized menu there, and I am not supposed to change the way it works.
 
Thanks for your help
 
Pearl


Posted By: Pearl
Date Posted: 23 October 2007 at 1:03pm
Hi, could you please give me some hints how can I resolve this problem if I have to overwrite OnSetPreviewMode()?
 
Thanks
 
Pearl


Posted By: Oleg
Date Posted: 23 October 2007 at 2:58pm
Hi,
if CMainFrame is CXTPMDIFrameWnd derived calss just call its OnSetPreviewMode method instead of CMDIFrameWnd.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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