Print Page | Close Window

PrintPreview does not work!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1454
Printed Date: 17 September 2025 at 2:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PrintPreview does not work!
Posted By: spike
Subject: PrintPreview does not work!
Date 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




Replies:
Posted By: Oleg
Date 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


Posted By: spike
Date 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



Posted By: Oleg
Date 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



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