|
-
April 14th, 1999, 07:43 AM
#1
Attaching Printer to CDC
How can I attach a printer to a CDC object without calling CPrintDialog and the CDC.Attach(GetPrinterDC())? Normally, you would have something like this:
CDC dc;
CPrintDialog printDlg(FALSE);
// ask the user to select a printer
if (printDlg.DoModal() == IDCANCEL)
return;
// Attach a printer DC
dc.Attach(printDlg.GetPrinterDC());
I already know what the printer device name is and I just want to assign that and bypass the dialog asking the user to select the printer. I think I need to eliminate the DoModal() and call printDlg.CreatePrinterDC() but I am not sure how to initialize the DEVMODE and/or DEVNAMES structures and how they are passed or utilized.
Also, how do you change the print margins after you have the printer DC?
Any info would be greatly appreciated.
Thanks,
Steve
Steven M. McNeese
http://[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|