|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Call this function from your override of OnPreparePrinting to invoke the Print dialog box and create a printer device context.
Points to a CPrintInfo structure that describes the current print job.
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.