• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 456
  • Last Modified:

How to change a printer CDC & IsPrinting


void MyDialog::DoBeginPrint()
   if (dc.IsPrinting())

So, How can I fill ??? so I can
call MeHappy() ??

Thanks, Tomas
1 Solution
Try to call
AfxGetApp()->SelectPrinter(NULL, NULL);
prior to CreatePrinterDC it should work

or you can use a

CPrintDialog and build your own CDC with CreateDC with all information from CPrintDialog, this dialog box can ask you wich printer to use or you can use the member function of this dialog named GetDefaults() to retrieve default printer, then use all information drivername, portname, devicename and devmode needed to Create a printable DC.

Hope that will help you...
Hajnin K.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now