Overview
If you're depending on the Win32 API alone, printing will be one of the tougher programming jobs you'll face. The Microsoft Foundation Class (MFC) library application framework goes a long way toward making printing easier, and it adds a print preview capability that behaves like the print preview functions in commercial Microsoft Windows–based programs such as Microsoft Word and Microsoft Excel.In this chapter, you'll learn how to use the MFC library print and print preview features. In the process, you'll get a feel for what's involved in Windows-based printing and how it's different from printing in MS-DOS. First, we'll do some WYSIWYG printing in which the printer output matches the screen display. This option requires careful use of mapping modes. Then we'll print a paginated data processing–style report that doesn't reflect the screen display at all. In that example, we'll use a template array to structure our document so the program can print any specified range of pages on demand.