MFC
Note: The CPageSetupDialog
Class
The CPageSetupDialog
class encapsulates the Page
Setup dialog that's often used with printing
functionality. It can be called to allow users to
specify the printer to be used, page size, and margins
of the printed output. Table 6.10 lists the common
methods used with the CPageSetupDialog
class.
Table 6.10
Primary CPageSetupDialog
Member Functions
Function
|
Description
|
CreatePrinterDC
|
Returns
a device context that can be used for printing.
|
GetDeviceName
|
Returns
the name of the selected printer.
|
GetDevMode
|
Returns
a structure containing information about the
selected printer and its capabilities (i.e. color
or black and white).
|
GetMargins
|
You
pass this method two pointers to either a CRect
class or a RECT structure, and it
populates the class or structures with the
dimensions of the margins and print area.
|
GetPaperSize
|
This
method returns a CSize class, which
specifies the current paper size.
|
GetDriverName
|
Returns
the name of the selected printer driver.
|
GetPortName
|
Returns
the name of the selected output port.
|
MFC
Example