CPrintDialog::m_pd
Una estructura cuyos miembros almacenan las características del diálogo.
PRINTDLG& m_pd;
Comentarios
Después de crear un objeto de CPrintDialog , puede utilizar m_pd para establecer distintos aspectos del cuadro de diálogo antes de llamar a la función miembro de DoModal .Para obtener más información sobre la estructura de m_pd , vea PRINTDLG en Windows SDK.
Si modifica el miembro de datos de m_pd directamente, reemplazará cualquier comportamiento predeterminado.
Ejemplo
// Display the Windows Print dialog box with "Pages" radio button
// initially selected. "All" and "Pages" radio buttons are
// enabled as well.
CPrintDialog dlg(FALSE, PD_PAGENUMS | PD_USEDEVMODECOPIES);
dlg.m_pd.nMinPage = dlg.m_pd.nFromPage = 1;
dlg.m_pd.nMaxPage = dlg.m_pd.nToPage = 10;
if (dlg.DoModal() == IDOK)
{
// Determine the starting and ending page numbers for the range
// of pages to be printed.
int from_page = -1, to_page = -1;
if (dlg.PrintAll()) // print all pages in the document
{
from_page = dlg.m_pd.nMinPage;
to_page = dlg.m_pd.nMaxPage;
}
else if (dlg.PrintRange()) // print only a range of pages
{ // in the document
from_page = dlg.GetFromPage();
to_page = dlg.GetToPage();
}
else if (dlg.PrintSelection()) // print only the currently selected
// items
{
from_page = to_page = -1; // -1 to denote unknown yet
}
TRACE(_T("Print from %d to %d\n"), from_page, to_page);
}
Requisitos
encabezado: afxdlgs.h