MFC
Note: The CPrintDialog
Class
The CPrintDialog
class encapsulates the standard Print
dialog used in most Windows applications.
This class contains most of the methods in the CPageSetupDialog,
except for GetPaperSize and GetMargin.
All the rest of the functions in Table 6.10 are
available in the CPrintDialog
class. Table 6.11 lists the other primary functions in
this class.
Table 6.11
Primary CPrintDialog
Member Functions
Function
|
Description
|
GetCopies
|
Returns
the number of copies specified to be printed.
|
GetFromPage
|
Returns
the starting page number when a range of pages
have been specified to be printed.
|
GetToPage
|
Returns
the ending page number when a range of pages have
been specified to be printed.
|
GetPrinterDC
|
Returns
a handle to the device context for the printer
specified.
|
PrintAll
|
Returns
a Boolean value specifying whether to print all
pages of the current document.
|
PrintCollate
|
Returns
a Boolean value specifying whether users requested
that the printed output be collated.
|
PrintRange
|
Returns
a Boolean value specifying whether users specified
a range of pages to be printed.
|
PrintSelection
|
Returns
a Boolean value specifying whether to print only
the selected items or pages.
|
Unlike with
the CPageSetupDialog, you can call the CreatePrinterDC
method without having called the DoModal method.
In fact, you don't have to show the dialog at all, but you
can use the class just to get the printer information and
device context, so you can print to the current printer
without displaying a dialog.