Hide

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

Display
Print

SftTree/DLL and SftTree/OCX

SftPrintPreview/DLL has built-in support for both SftTree/DLL and SftTree/OCX, allowing print preview and printing of tree control contents. All attributes of these tree controls are fully supported and are rendered, including bitmaps, headers, etc.

The PreviewSftTree sample demonstrates how a tree control is used with SftPrintPreview/DLL. The source code for this sample is included for both C and C++/MFC and is available in the product directory \Program Files\Softelvdm\SftPrintPreview DLL 2.0\Samples.

SftTree/DLL 5.0, SftTree/OCX 5.0 and newer versions are fully supported with SftPrintPreview/DLL. Older versions of these controls are not supported, as the actual rendering support is offered by the tree controls, not SftPrintPreview/DLL.

The contents of the tree control are displayed across the full width of the page. If the tree control contents are wider than the width of the available area, any remaining contents are clipped (and lost). The iContentSizing member of the SFTPRINTPREVIEW_CONTROL structure has no effect, when previewing/printing a tree control.

When previewing/printing a tree control, only TrueType or ClearType fonts should be used, to insure proper scaling and resizing of all generated output.

Example

C

SFTPRINTPREVIEW_CONTROL Ctl;

Ctl.cbSize = sizeof(SFTPRINTPREVIEW_CONTROL);
if (!SftPrintPreview_GetControlInfo(hwndCtl, &Ctl))
    _ASSERT(0); // error handling

// define desired contents to preview/print
Ctl.lpDrawPageWorkArea = (SFTPRINTPREVIEW_DWORD_PTR) NULL;
Ctl.lpDrawInfoProc = NULL; // no callback
Ctl.hwndContent = hwndTree; // SftTree/DLL window
Ctl.hwndData = NULL; // no data window (content window is data window)

if (!SftPrintPreview_SetControlInfo(hwndCtl, &Ctl)) {
    int errorValue = Ctl.errorValue;
    _ASSERT(0); // an error occurred, check errorValue for error codes
}

C++

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

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