CPrintDialog::CreatePrinterDC

创建从 DEVMODEDEVNAMES 结构的打印机上下文(DC)。

HDC CreatePrinterDC( );

返回值

为新创建的打印机上下文的句柄。

备注

此DC假定为当前打印机DC,因此,任何其他以前获取了必须由用户删除DC的打印机。此函数可调用,并且,发生的DC,使用,而不显示打印对话框。

示例

// Display the Windows Print dialog box with "All" radio button 
// initially selected. All other radio buttons are disabled.
CPrintDialog dlg(FALSE);
if (dlg.DoModal() == IDOK)
{
   // Create a printer device context (DC) based on the information
   // selected from the Print dialog.
   HDC hdc = dlg.CreatePrinterDC();
   ASSERT(hdc);
}

要求

Header: afxdlgs.h

请参见

参考

CPrintDialog选件类

层次结构图

CPrintDialog::GetDevMode