-
Printing formatted text
Hi i'm building this simple text editor. It's a dialog based MFC app with a CRitchEdit control and i need to print the formatted text in this CRitchEdit control. i know the basics of printing: you create a instance of CPrintDialog and get the printing info from the user, then you call StartDoc and StartPage functions etc. But i need to know how to print the text in the CRitchEdit control exactly as the way it is. Please help.
-
Printing is the same as doing a WM_PAINT but changing the DC to a CPrinterDC. Notice the paint message handler requires a CDC object. It just so happens that CPaintDC, CWindowDC, ClientDC, and CPrinterDC are all derived from CDC.
So in short...you paint onto the printer which prints the document.