Hide

SftPrintPreview/DLL 2.0 - Print Preview Control for C/C++

Display
Print

CSftPrintPreview_Main::FilePrintPreview Function

The FilePrintPreview function creates a Print Preview window displaying the specified contents.

C++

void CSftPrintPreview_Main::FilePrintPreview(
    CView* pMainView,
    CRuntimeClass* pPreviewViewClass,
    HWND hContentWindow = NULL, HWND hDataWindow = NULL,
    SFTPRINTPREVIEW_DRAWINFOPROC lpDrawInfoProc = NULL,
    SFTPRINTPREVIEW_DWORD_PTR lpDrawPageWorkArea = NULL);

Parameters

pMainView

A pointer to the CView- and CSftPrintPreview_Main-derived window, whose contents are to be previewed.

pPreviewViewClass

The class implementing the Print Preview view, always derived from the CSftPrintPreview_View class.

hContentWindow

The window whose contents are to be previewed. If no drawing callback lpDrawInfoProc is provided, this window must support printing and print preview using the SFTPRINTPREVIEW_CONTENTWINDOWMESSAGE protocol. SftTree/DLL and SftTree/OCX 5.0 (and up) can be rendered in this manner. RichEdit controls require the use of the drawing callback SftPrintPreview_RenderRicheditWindow_Callback. For application-generated output, this parameter must be set to NULL.

hDataWindow

SftTree/DLL and SftTree/OCX 5.0 (and up) support the data window handle hDataWindow. If hDataWindow is not NULL, the tree control defined by hContentWindow is rendered using the data (items, cells, etc.) provided by hDataWindow. For application-generated output and RichEdit controls, this parameter must be set to NULL.

lpDrawInfoProc

The address of a drawing callback of type SFTPRINTPREVIEW_DRAWINFOPROC, which is used to render pages for preview and printing purposes. RichEdit controls require the use of the drawing callback SftPrintPreview_RenderRicheditWindow_Callback. For application-generated output and SftTree/DLL and SftTree/OCX, this parameter must be set to NULL.

lpDrawPageWorkArea

An application-defined value used when calling the provided lpDrawInfoProc drawing callback. This value is passed to the callback function as the lpDrawPageWorkArea member of the SFTPRINTPREVIEW_DRAWINFO structure. For application-generated output and SftTree/DLL and SftTree/OCX, this parameter must be set to NULL.

Comments

The FilePrintPreview function creates a Print Preview window displaying the specified contents.

Example

C++

BEGIN_MESSAGE_MAP(CPreviewSftTreeView, CView)
    ON_COMMAND(ID_FILE_PRINT_PREVIEW, OnFilePrintPreview)
END_MESSAGE_MAP()

afx_msg void OnFilePrintPreview()
{
    FilePrintPreview(this, RUNTIME_CLASS(CTreePreview), m_Tree.m_hWnd);
}

See Also C/C++ API | C++ Classes | Notifications


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.