CPrintDialog::CreatePrinterDC
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