CPrintDialog::PrintCollate

更新 : 2007 年 11 月

コピー時に部単位の印刷が要求されているかどうかを調べます。

BOOL PrintCollate( ) const;

戻り値

ダイアログ ボックスの [部単位に印刷] チェック ボックスをオンにしている場合は 0 以外の値を返します。それ以外の場合は 0 を返します。

解説

DoModal 関数を呼び出し後この関数を呼び出して、文書を複数部数印刷するときに部単位に印刷するかどうかを調べます。

使用例

// Display the Windows Print dialog box with Collate check box checked.
CPrintDialog dlg(FALSE, PD_ALLPAGES | PD_COLLATE | PD_NOPAGENUMS | 
   PD_HIDEPRINTTOFILE);
if (dlg.DoModal() == IDOK)
{
   // If the collate check box is selected, then GetCopies() will return
   // the number of copies printed. Otherwise, GetCopies() always 
   // returns 1. Then, the number of copies printed can be found from the
   // DEVMODE structure of the printing device.
   if (dlg.PrintCollate())
   {
      int num = dlg.GetCopies();
      TRACE(_T("Number of copies printed = %d\n"), num);
   }
   else
   {
      LPDEVMODE devmode = dlg.GetDevMode();
      TRACE(_T("Number of copies printed = %d\n"), devmode->dmCopies);
   }
}

必要条件

ヘッダー : afxdlgs.h

参照

参照

CPrintDialog クラス

階層図

CPrintDialog::GetCopies

その他の技術情報

CPrintDialog のメンバ