Share via


COleDocument::ApplyPrintDevice

Call this function to change the print-target device for all embedded COleClientItem items in your application's container document.

BOOL ApplyPrintDevice( 
   const DVTARGETDEVICE* ptd  
); 
BOOL ApplyPrintDevice( 
   const PRINTDLG* ppd  
);

Parameters

  • ptd
    Pointer to a DVTARGETDEVICE data structure, which contains information about the new print-target device. Can be NULL.

  • ppd
    Pointer to a PRINTDLG data structure, which contains information about the new print-target device. Can be NULL.

Return Value

Nonzero if the function was successful; otherwise 0.

Remarks

This function updates the print-target device for all items but does not refresh the presentation cache for those items. To update the presentation cache for an item, call COleClientItem::UpdateLink.

The arguments to this function contain information that OLE uses to identify the target device. The PRINTDLG structure contains information that Windows uses to initialize the common Print dialog box. After the user closes the dialog box, Windows returns information about the user's selections in this structure. The m_pd member of a CPrintDialog object is a PRINTDLG structure.

For more information, see the PRINTDLG structure in the Windows SDK.

For more information, see the DVTARGETDEVICE structure in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleDocument Class

Hierarchy Chart

CPrintDialog Class

Other Resources

COleDocument Members