![]() |
print preview issue |
Post Reply ![]() |
Author | |
Pearl ![]() Newbie ![]() Joined: 17 September 2007 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Check may be you override CMainFrame::OnSetPreviewMode method and don't call base CXTPFrameWnd method.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Pearl ![]() Newbie ![]() Joined: 17 September 2007 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Pearl ![]() Newbie ![]() Joined: 17 September 2007 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Pearl ![]() Newbie ![]() Joined: 17 September 2007 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Pearl ![]() Newbie ![]() Joined: 17 September 2007 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Hi, could you please give me some hints how can I resolve this problem if I have to overwrite OnSetPreviewMode()?
Thanks
Pearl
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
if CMainFrame is CXTPMDIFrameWnd derived calss just call its OnSetPreviewMode method instead of CMDIFrameWnd.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |