How To Print from a Class Other Than CView (133275)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++ for Windows, 16-bit edition 1.51
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
This article was previously published under Q133275 SUMMARY
The standard method to support printing capability in an MFC application is
to override the OnDraw(CDC* pDC) member function of the CView class that
provides the pointer to the device context (pDC). If the application does
not possess a CView class (for example, a dialog-based application), you
can use the code listed in this article to obtain a pointer to the printing
device context to implement printing.
REFERENCES
For more information about the MFC printing, please see "Programming with
the Microsoft Foundation Class Library" in Books Online.
| Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
|---|
| Keywords: | kbcode kbhowto kbprint kbProgramming KB133275 |
|---|
|