Hide

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

Display
Print

SetControlInfo Function

The SetControlInfo function defines the Print Preview control attributes.

C

BOOL SftPrintPreview_SetControlInfo(HWND hwnd, LPSFTPRINTPREVIEW_CONTROL lpCtl);

C++

BOOL CSftPrintPreview::SetControlInfo(LPSFTPRINTPREVIEW_CONTROL lpCtl);

Parameters

hwnd

The window handle of the Print Preview control.

lpCtl

A pointer to a SFTPRINTPREVIEW_CONTROL structure defining the new Print Preview control attributes. The original contents should be retrieved using the GetControlInfo function.

Returns

The return value is TRUE if the function was successful, false otherwise.

Comments

The SetControlInfo function defines the Print Preview control attributes.

The GetControlInfo function retrieves the Print Preview control attributes. Some of the structure values returned can be modified and updated using the SetControlInfo function. See SFTPRINTPREVIEW_CONTROL for more information.

If the SetControlInfo function fails, the SFTPRINTPREVIEW_CONTROL structure's errorValue member contains an error code, indicating which structure member has caused the failure.

Error Code Invalid SFTPRINTPREVIEW_CONTROL structure member
100marginX
101marginY
102zoom
104fOwnDevHandles or any fields associated with fOwnDevHandles
107offsetX
108offsetY
109numPageRows
110numPageGroups
111marginPageGroup
112marginShadow
113maxPageRows
114maxPageGroups
115zoomIncrDecr
116fltLeftMargin
117fltTopMargin
118fltRightMargin
119fltBottomMargin
120fltHeaderFromEdge
121fltFooterFromEdge
122fltGutterMargin
123iUnitsOfMeasure
124iPrintPages
125iContentSizing
126iZoomStyle
127hwndContent
128hwndData

Example

C

SFTPRINTPREVIEW_CONTROL Ctl;
Ctl.cbSize = sizeof(SFTPRINTPREVIEW_CONTROL);
if (!SftPrintPreview_GetControlInfo(hwndCtl, &Ctl))
    _ASSERT(0);
// set all desired options
Ctl.numPageRows = 1; // default to 1x2 pages
Ctl.numPageGroups = 2;
Ctl.zoom = 0; // start out with multiple pages
lstrcpy(Ctl.szOutputName, TEXT("SftPrintPreview PreviewPages Sample Output"));
lstrcpy(Ctl.szHeaderRight, TEXT("SftPrintPreview/DLL PreviewPages Sample"));
lstrcpy(Ctl.szFooterLeft, TEXT("www.softelvdm.com"));

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

C++

SFTPRINTPREVIEW_CONTROL Ctl;
Ctl.cbSize = sizeof(SFTPRINTPREVIEW_CONTROL);
if (!m_Preview.GetControlInfo(&Ctl))
    _ASSERT(0);
// set all desired options
Ctl.numPageRows = 1; // default to 1x2 pages
Ctl.numPageGroups = 2;
Ctl.zoom = 0; // start out with multiple pages
lstrcpy(Ctl.szOutputName, TEXT("SftPrintPreview RichEdit Output"));
lstrcpy(Ctl.szHeaderRight, TEXT("SftPrintPreview/DLL RichEdit Preview Sample"));
lstrcpy(Ctl.szFooterLeft, TEXT("www.softelvdm.com"));

if (!m_Preview.SetControlInfo(&Ctl)) {
    int errorValue = Ctl.errorValue;
    _ASSERT(0); // an error occurred, check errorValue for error code
}

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


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