Void PrintTest ()
{
CPRINTDIALOG DLG (false, pd_allpages | PD_COLLATE | PD_NOPAGENUMS | PD_HIDEPRINTTOFILE);
IF (Dlg.getDefaults ())
{
DEVMODE FAR * PDEVMODE = (DEVMODE FAR *) :: Globalock (DLG.M_PD.HDEVMODE);
PDEVMODE-> DMORIENTATION = DMORIENT_PORTRAIT; / / Change to portrait print
:: GlobalUnlock (dlg.m_pd.hdevmode);
Docinfo Di;
MEMSET (& DI, 0, SIZEOF (Docinfo);
Di.cbsize = sizeof (docinfo);
Di.lpszdocname = "Printing Test";
Di.lpszoutput = (lptstr) NULL;
Di.fWType = 0;
HDC HDC = DLG.CREATEPRINTERDC ();
CDC DC;
Dc.attach (HDC);
Dc.startDoc (& di);
Dc.startPage ();
Dc.moveto (0);
DC.LineTo (1000, 1000);
dc.endpage ();
Dc.Enddoc ();
dc.deletedc ();
}
}