获取打印机的DC [英] Get DC for printer
本文介绍了获取打印机的DC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下命令获取打印机的DC:
I''m using the following to get the DC for the printer:
CDC dc;
if(!AfxGetApp()->CreatePrinterDC(dc))
AfxMessageBox("unable to create dc");
但是,它总是返回FALSE.所以请帮帮我...
谢谢
必须调用Vivek Chauhan
But, it always returns FALSE. So please help me out...
Thanks
Vivek Chauhan
推荐答案
CWinApp::UpdatePrinterSelection
才能获得有效的DC
.如果您遵循文档中建议的步骤,则会自动执行此调用: 如何在MFC中创建打印机设备上下文(DC)" .
:)
CWinApp::UpdatePrinterSelection
must be called in order to obtain a validDC
. This call is automatically performed if you follows the steps suggested in the documentation: "How To Create a Printer Device Context (DC) in MFC".
:)
这篇关于获取打印机的DC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文