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. C / C++ / MFC
  4. Using common dialog box: Print

Using common dialog box: Print

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
2 Posts 2 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.
  • B Offline
    B Offline
    bugDanny
    wrote on last edited by
    #1

    I'm trying to use the Print dialog box in my program. MSDN provides wonderful instruction on how to create the dialog box and display it with certain options, etc., etc., but I can't seem to find from MSDN the code to actually get the ink from the printer to the paper and what to be putting on the paper. I display the dialog, the user can make all kinds of nice selections, but how do I tell it what to print, and how do I make the printer move? Danny

    H 1 Reply Last reply
    0
    • B bugDanny

      I'm trying to use the Print dialog box in my program. MSDN provides wonderful instruction on how to create the dialog box and display it with certain options, etc., etc., but I can't seem to find from MSDN the code to actually get the ink from the printer to the paper and what to be putting on the paper. I display the dialog, the user can make all kinds of nice selections, but how do I tell it what to print, and how do I make the printer move? Danny

      H Offline
      H Offline
      Hamed Musavi
      wrote on last edited by
      #2

      Hi, you should use a DC(attach it to your print dialog printer DC), Start a document->start a page-> do whatever you want with the DC(whatever you do will be printed!)->end your page->end your document look below: CPrintDialog PDlg(FALSE); CDC PDC; /* You don't need this part, since you used the customized dialog if(!PDlg.GetDefaults()) { AfxMessageBox("Error"); return; } */ PDC.Attach(PDlg.GetPrinterDC()); PDC.StartDoc("New Name, will apear in systray"); PDC.StartPage(); PDC.TextOut(0,0,"HELLO!"); PDC.EndPage(); PDC.EndDoc();

      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