CPrintDialog::CreatePrinterDC

更新 : 2007 年 11 月

DEVMODE 構造体と DEVNAMES 構造体からプリンタ デバイス コンテキスト (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);
}

必要条件

ヘッダー : afxdlgs.h

参照

参照

CPrintDialog クラス

階層図

CPrintDialog::GetDevMode

その他の技術情報

CPrintDialog のメンバ