Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Question CExtPPVW_Base Collapse All
Subject Author Date
tera t May 13, 2008 - 2:14 AM

Hello.


I may have still inquired it.

Is not the setting of print pages possible?


Thanks,


 

tera t May 14, 2008 - 9:04 PM

Hello.


I can appoint print pages when I make it DoPrintDoc(true).

I want to use this function by all means. 

Will there be any problem?




void CExtPPVW_HostWnd::OnPreviewPrint()

{

 if( m_pPpvPrintable == NULL )

  return;

 GetParent()->ShowWindow( SW_HIDE ); // hide container window

HWND hWndOwn = GetSafeHwnd();

 ASSERT( hWndOwn != NULL );

 m_pPpvPrintable->DoPrintDoc( true );


Technical Support May 16, 2008 - 1:52 PM

The CExtPPVW template class is derived from the CExtPPVW_Printable helper class which has the following two bool properties: m_bUsePrintDialogFromOutside and m_bUsePrintDialogFromPreview. Both of these properties are set by default to false. The m_bUsePrintDialogFromPreview property defines whether the standard print dialog should be displayed when the Print button is clicked in the inner toolbar of the print preview window. The m_bUsePrintDialogFromOutside property defines whether the standard print dialog should be displayed when the ID_FILE_PRINT command is handled by the CExtPPVW-based class from outside the print preview UI. You can set them to true to see the dialog you need.

tera t May 18, 2008 - 6:32 PM

Hello.


I carry it out with a mode for mbs-Debug.

Assert appears.




m_bUsePrintDialogFromPreview = true


-------------------------------------------

DLGPRNT.cpp


int CPrintDialog::DoModal()

{

 ASSERT_VALID(this);

 ASSERT(m_pd.Flags & PD_ENABLEPRINTHOOK);

 ASSERT(m_pd.Flags & PD_ENABLESETUPHOOK);


-------------------------------------------


After I was troubled

I copied an ExtPrint.cpp source, and Assert did not appear.

The problem was settled. 

Technical Support May 14, 2008 - 6:27 AM

The CExtPPVW_Base class is just a container for some algorithms which are required in the CExtPPVW template class. It’s not possible to use the CExtPPVW template class with any abstract window for adding ready-to-use printing and previewing to it. Prof-UIS provides several specialized versions of the CExtPPVW template class and the specialized classes are ready-to-use print preview versions for particular Prof-UIS classes. The print previewing subsystem is supported for all Prof-UIS grid controls. The CExtPPVW template class can be used with MFC view windows based on the CView class or derived from it. This is possible because the API of CExtPPVW class is very similar or exactly the same as in CView. If you need print preview features for your custom class (window or control), you should derive it from a CExtPPVW-based type and implement at least the CExtPPVW_Printable::OnPreparePrinting() virtual method which completely initializes the cache of Windows metafiles (one metafile for each page) in a temporarily created folder. You may also need to implement other virtual methods so that you can determine whether the printing/previewing feature is available (the CExtPPVW_Printable::IsPrintPreviewAvailable() virtual method) or show printing progress (a set of CExtPPVW_Printable::OnPreparePrinting_***() virtual methods).