CPrintDialog dlg(TRUE, PD_RETURNDC); CDC printerDC; dlg.GetDefaults(); printerDC.Attach(dlg.GetPrinterDC());