CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Location
    Albuquerque, NM
    Posts
    12

    Changing the number of copies per page on the fly

    I want to print as many copies of page 1 of my document as the user specifies. I then want to print ONE copy of page 2.
    So I do the following:
    void CMyView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
    {
    if (pDC->IsPrinting() && (pInfo->m_nCurPage==2))
    {
    LPDEVMODE pDevMode = pInfo->m_pPD->GetDevMode();
    pDevMode->dmCopies = 1;

    // Make sure that all objects other than the stock objects
    // that had been selected into the device context have been
    // selected out.
    pDC->ResetDC(pDevMode);
    }

    // Call the base class OnPrepareDC.
    CView::OnPrepareDC(pDC,pInfo);
    }




    Unfortunely, page 2 is printed as many time as page 1. Now get this; if I change the code so that I change the number of page 1 copies to one, then page 2 gets changed to one copy.

    Any other changes I make to the DEVMODE work perfectly. I can change orientation, paper size; anything but the number of copies!!
    Help !!

    Geno Carman
    [email protected]



  2. #2
    Join Date
    Oct 1999
    Location
    WA
    Posts
    2,393

    Re: Changing the number of copies per page on the fly

    Copy number is implemented as a document level setting. It affects the whole document. Send page 1 multiple times.

    http://www.fengyuan.com (Author of Windows Graphics Programming: Win32 GDI and DirectDraw)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured