다음을 통해 공유


CPrintDialog::PrintCollate

요청 복사본 한 부씩 인쇄 여부를 결정 합니다.

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 클래스

계층 구조 차트

디버깅