CPrintInfo Structure

Stores information about a print or print-preview job.

struct CPrintInfo

Remarks

CPrintInfo is a structure and does not have a base class.

The framework creates an object of CPrintInfo each time the Print or Print Preview command is chosen and destroys it when the command is completed.

CPrintInfo contains information about both the print job as a whole, such as the range of pages to be printed, and the current status of the print job, such as the page currently being printed. Some information is stored in an associated CPrintDialog object; this object contains the values entered by the user in the Print dialog box.

A CPrintInfo object is passed between the framework and your view class during the printing process and is used to exchange information between the two. For example, the framework informs the view class which page of the document to print by assigning a value to the m_nCurPage member of CPrintInfo; the view class retrieves the value and performs the actual printing of the specified page.

Another example is the case in which the length of the document is not known until it is printed. In this situation, the view class tests for the end of the document each time a page is printed. When the end is reached, the view class sets the m_bContinuePrinting member of CPrintInfo to FALSE; this informs the framework to stop the print loop.

CPrintInfo is used by the member functions of CView listed under "See Also." For more information about the printing architecture provided by the Microsoft Foundation Class Library, see Frame Windows and Document/View Architecture and the articles Printing and Printing: Multipage Documents.

Requirements

Header: afxext.h

See Also

Concepts

DIBLOOK Sample: Illustrates the Use of DIBs and Color Palettes

CPrintInfo Members

Hierarchy Chart

CView::OnBeginPrinting

CView::OnEndPrinting

CView::OnEndPrintPreview

CView::OnPrepareDC

CView::OnPreparePrinting

CView::OnPrint