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. Print Preview problem

Print Preview problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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
    Bravoone_2006
    wrote on last edited by
    #1

    How can i do print preview for this : ((i have a CButton OnPrint(IDC_PRINT))CDialog Base aplication) void CMyPrintDlg::OnPrint(CDC* pDC, CPrintInfo* pInfo) { CPrintDialog dlgPrint(FALSE,PD_ALLPAGES,this); if (dlgPrint.DoModal()==IDOK) { // ** Attach the printer DC from the dialog // ** to a CDC object CDC dcPrint; dcPrint.Attach(dlgPrint.GetPrinterDC()); // ** Create and fill a DOCINFO structure DOCINFO myPrintJob; myPrintJob.cbSize = sizeof(myPrintJob); myPrintJob.lpszDocName = "printing..."; myPrintJob.lpszOutput = NULL; myPrintJob.lpszDatatype = NULL; myPrintJob.fwType = NULL; // ** Start the printing document if (dcPrint.StartDoc(&myPrintJob)>=0) { // ** Start a page dcPrint.StartPage(); CString sText; sText = "this :"; CString sText1; sText1 = "How ?"; //////////////////////////////////////////////////////////////////////////////////////// dcPrint.TextOut(2000,350,sText); dcPrint.TextOut(300,500,sText1) // ** Throw the page dcPrint.EndPage(); // ** Close the document dcPrint.EndDoc(); } dcPrint.DeleteDC(); } } Please help me !

    Bravoone

    R 1 Reply Last reply
    0
    • B Bravoone_2006

      How can i do print preview for this : ((i have a CButton OnPrint(IDC_PRINT))CDialog Base aplication) void CMyPrintDlg::OnPrint(CDC* pDC, CPrintInfo* pInfo) { CPrintDialog dlgPrint(FALSE,PD_ALLPAGES,this); if (dlgPrint.DoModal()==IDOK) { // ** Attach the printer DC from the dialog // ** to a CDC object CDC dcPrint; dcPrint.Attach(dlgPrint.GetPrinterDC()); // ** Create and fill a DOCINFO structure DOCINFO myPrintJob; myPrintJob.cbSize = sizeof(myPrintJob); myPrintJob.lpszDocName = "printing..."; myPrintJob.lpszOutput = NULL; myPrintJob.lpszDatatype = NULL; myPrintJob.fwType = NULL; // ** Start the printing document if (dcPrint.StartDoc(&myPrintJob)>=0) { // ** Start a page dcPrint.StartPage(); CString sText; sText = "this :"; CString sText1; sText1 = "How ?"; //////////////////////////////////////////////////////////////////////////////////////// dcPrint.TextOut(2000,350,sText); dcPrint.TextOut(300,500,sText1) // ** Throw the page dcPrint.EndPage(); // ** Close the document dcPrint.EndDoc(); } dcPrint.DeleteDC(); } } Please help me !

      Bravoone

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      Check out this article: http://www.codeproject.com/printing/printextension.asp[^]

      If you vote me down, my score will only get lower

      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