Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - PrintPreview does not work!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PrintPreview does not work!

 Post Reply Post Reply
Author
Message
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Topic: PrintPreview does not work!
    Posted: 24 November 2004 at 3:58pm

I am trying to get PrintPreview to work using the XTPPrintPreview class in my project.

 

void CSchedulerFormView::OnToolBarButtonClick(UINT nID)
{
 switch( nID )
 {
  case ID_SCHEDULER_PRINT:
  {
   break;
  }
  case ID_SCHEDULER_REFRESH:
  {
   OnScheduleComboAfterUpdate(0,0);
   break;
  }
  case ID_SCHEDULER_PREVIEW:
  {
   CPrintPreviewState* pState = new CPrintPreviewState;

   if ( !DoPrintPreview( XTP_IDD_PREVIEW_TOOLBAR, this,
    RUNTIME_CLASS( CXTPPreviewView ), pState ))
   {
    // In derived classes, reverse special window handling here for
    // Preview failure case;
    delete pState;
   }
   break;
  }
 }
}

BOOL CSchedulerFormView::OnPreparePrinting(CPrintInfo* pInfo)
{
 // default CEditView preparation
 return DoPreparePrinting(pInfo);
}

void CSchedulerFormView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
 // Default CEditView begin printing.
 CProjectBASEFormView::OnBeginPrinting(pDC, pInfo);
}

void CSchedulerFormView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
 // Default CEditView end printing
 CProjectBASEFormView::OnEndPrinting(pDC, pInfo);
}

I have that code and it gets called with no problems, but the print preview window is empty. Which is the same thing that happens in the PrintPreview sample. The only difference is I in the PrintPreview sample you use CEditView (which only shows the first character in preview mode) and I am using a CFormView. On my preview window I get an empty white preview window.

Can someone who has gotten this to work show me what I am doing wrong or let me know if it doesnt work?

 

Thanks

Craig

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 25 November 2004 at 1:11am

CFormView hasn't preview output.

You can easy check it: Create simple MFC application with CFormView as view class. Print Preview will show empty window.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2004 at 3:00pm

Oleg,

Even so, the print preview sample does not work. Try for yourself. Type something in the document and preview it. On any machine I have tried it on I only see the first character

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 30 November 2004 at 12:49am

It is bug of MFC 4.2 with manifest used.

try to comment in rc file:

IDR_MANIFEST             24      DISCARDABLE     "res\\manifest.xml"

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