How To Create a Printer Device Context (DC) in MFC (162609)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.2
This article was previously published under Q162609 SUMMARY
When you create a printer device context (DC) in Windows SDK programming,
an application must retrieve ::CreateDC()'s parameters (such as driver
name, device name and output port) from either a Win.ini file (16-bit) or a
Windows registry (32-bit). In Microsoft Foundation Classes, this can be
done via a call to functions CWinApp::GetPrinterDeviceDefaults() and
CPrintDialog::CreatePrinterDC().
This article shows you a way to create a printer device context using the
default selected printer without displaying the Print dialog box. To create
a printer device context for a non-default printer, please refer to Chapter
15 of "Programming Windows 3.1" by Charles Petzold.
REFERENCES
"Programming Windows 3.1," Charles Petzold, Chapter 15, Microsoft Press,
1992
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbcode kbhowto kbprint KB162609 |
---|
|