Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Problems to print

Problems to print

Scheduled Pinned Locked Moved ATL / WTL / STL
data-structuresdatabasehelpquestionworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dansveen
    wrote on last edited by
    #1

    Hi All I have problems to send print in my application. If I send print and if I change my view before ready to print, all commands will be cancelled. I send direct to print, print setup is not showed, the view can be closed, and OpenDocumentFile doesn't show this view if command is print; My application needs fill a graph, reading from a database, while not read all data he is not ready to print, I have a flag to do this. See my code:

    //if the document was found, try to print it
    if(pDoc!=NULL)
    {
    //if document is ready for printing, print it now
    dwTick=::GetTickCount();
    nPrintWindowTimeout=5;
    if(nPrintWindowTimeout<0)
    nPrintWindowTimeout=0;
    dwWaitLimit=(DWORD)nPrintWindowTimeout*1000;
    if(pDoc->IsReadyForPrintWindow() || (dwTick < item.m_dwTickStart || dwTick - item.m_dwTickStart > dwWaitLimit) )
    {
    //remove screen from the queue
    m_arPrintQueue.RemoveAt(0);
    //print
    pDoc->SetPrinting(TRUE);
    if (pDoc->GetView())
    {
    if (item.m_bPrintSetup == TRUE)
    pDoc->GetView()->SendMessage(WM_COMMAND, ID_FILE_PRINT_SETUP);
    else
    // But if I change my view this is never executed, the message queue is not keeping this in another view
    // This is sended in a CView, not in MainFrame, my derived CView process WM_COMMAND
    pDoc->GetView()->SendMessage(WM_COMMAND, ID_FILE_PRINT);
    }
    pDoc->SetPrinting(FALSE);
    pDoc->OnCloseDocument();
    }
    }
    }

    Somebody, can help me? Thank you

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups