IPrintDialogServices

[This is preliminary documentation and subject to change.]

The IPrintDialogServices interface enables an application using the PrintDlgEx function to retrieve information about the currently selected printer. This printer is indicated on the list of installed printers on the General page of the Print property sheet.

When to Implement

Applications do not implement the IPrintDialogServices interface. The PrintDlgEx function implements this interface.

When to Use

Applications that call the PrintDlgEx function can use the IPrintDialogServices interface to retrieve information about the currently selected printer while the Print property sheet is displayed. The IPrintDialogServices interface is useful for applications that implement the IPrintDialogCallback interface to process messages and notifications for the child dialog box in the lower portion of the General page.

The IPrintDialogServices interface is also useful for applications that create additional pages to follow the General page. The dialog box procedures for the additional pages can call IPrintDialogServices methods.

To retrieve a pointer to the IPrintDialogServices interface, implement a callback object that contains the IObjectWithSite class. When you call PrintDlgEx, you can specify a pointer to your callback object in the lpCallback member of the PRINTDLGEX structure. PrintDlgEx calls the IObjectWithSite::SetSite method to pass a pointer to an IPrintDialogServices interface to the application.

Methods in VTable Order

IUnknown Methods

QueryInterface
AddRef
Release

IPrintDialogServices Methods

Method Description
GetCurrentDevMode Fills a DEVMODE structure with information about the currently selected printer.
GetCurrentPrinterName Retrieves the name of the currently selected printer.
GetCurrentPortName Retrieves the name of the current port.