Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - print preview issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

print preview issue

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


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post Topic: print preview issue
    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
 
 
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Pearl View Drop Down
Newbie
Newbie


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Pearl View Drop Down
Newbie
Newbie


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2007 at 2:09am
Hi,
 
Send to 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
Back to Top
Pearl View Drop Down
Newbie
Newbie


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Pearl View Drop Down
Newbie
Newbie


Joined: 17 September 2007
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pearl Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.109 seconds.