Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I'm using the following to get the DC for the printer:

C++
CDC dc;
if(!AfxGetApp()->CreatePrinterDC(dc))
     AfxMessageBox("unable to create dc");


But, it always returns FALSE. So please help me out...

Thanks
Vivek Chauhan
Posted
Updated 7-Jun-10 22:54pm
v3

1 solution

CWinApp::UpdatePrinterSelection must be called in order to obtain a valid DC. This call is automatically performed if you follows the steps suggested in the documentation: "How To Create a Printer Device Context (DC) in MFC".
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900