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

How to change a printer CDC & IsPrinting

Hi,

void MyDialog::DoBeginPrint()
{
   AfxGetApp()->CreatePrinterDC(dc);
   ???
   if (dc.IsPrinting())
       MeHappy();
}

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

Thanks, Tomas
0
tko092397
Asked:
tko092397
1 Solution
 
deeslyCommented:
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.
 
0

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