Hide

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

Display
Print

GetControlInfo Function

The GetControlInfo function retrieves the Print Preview control attributes.

C

BOOL SftPrintPreview_GetControlInfo(HWND hwnd, LPSFTPRINTPREVIEW_CONTROL lpCtl);

C++

BOOL CSftPrintPreview::GetControlInfo(LPSFTPRINTPREVIEW_CONTROL lpCtl) const;

Parameters

hwnd

The window handle of the Print Preview control.

lpCtl

A pointer to a SFTPRINTPREVIEW_CONTROL structure. This structure will be updated with the current Print Preview control attributes. The cbSize member of the SFTPRINTPREVIEW_CONTROL structure must be initialized to the size of the structure (sizeof(SFTPRINTPREVIEW_CONTROL)) before calling GetControlInfo.

Returns

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

Comments

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.

The cbSize member of the SFTPRINTPREVIEW_CONTROL structure must be initialized to the size of the structure (sizeof(SFTPRINTPREVIEW_CONTROL)) before calling GetControlInfo.

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.