Share via


CView::DoPreparePrinting

BOOLDoPreparePrinting(CPrintInfo*pInfo);

Return Value

Nonzero if printing or print preview can begin; 0 if the operation has been canceled.

Parameters

pInfo

Points to a CPrintInfo structure that describes the current print job.

Remarks

Call this function from your override of OnPreparePrinting to invoke the Print dialog box and create a printer device context.

This function’s behavior depends on whether it is being called for printing or print preview (specified by the m_bPreview member of the pInfo parameter). If a file is being printed, this function invokes the Print dialog box, using the values in the CPrintInfo structure that pInfo points to; after the user has closed the dialog box, the function creates a printer device context based on settings the user specified in the dialog box and returns this device context through the pInfo parameter. This device context is used to print the document.

If a file is being previewed, this function creates a printer device context using the current printer settings; this device context is used for simulating the printer during preview.

CView OverviewClass MembersHierarchy Chart

See Also   CPrintInfo, CView::OnPreparePrinting