Hide

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

Display
Print

CSftPrintPreview_Main::FilePrint Function

The FilePrint function prints the specified contents.

C++

void CSftPrintPreview_Main::FilePrint(
    CView* pMainView,
    BOOL fDialog,
    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 printed.

fDialog

Set to TRUE if the Print dialog should be displayed first, FALSE otherwise, in which case printing on the current default printer starts immediately.

pPreviewViewClass

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

hContentWindow

The window whose contents are to be printed. 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 FilePrint function prints the specified contents.

Example

C++

BEGIN_MESSAGE_MAP(CPreviewSftTreeView, CView)
    ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
END_MESSAGE_MAP()

afx_msg void OnFilePrint()
{
    FilePrint(this, TRUE, 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.