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. Printing multiple Views in MFC

Printing multiple Views in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpdesignhelpquestion
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.
  • S Offline
    S Offline
    suzie100
    wrote on last edited by
    #1

    Hi, I am a newbiew to .NET, MFC and Visual C++. I have multiple Views (Say View A, B and C), and a Document in my Design. On the Print and Print Preview I need to print information from all the views. Currently I have overloaded the OnPrint() function in View A. After View A 's print is done, how do I get it to Print View B and View C's Data. Should I post a Message to View B and C passing the CDC object, and each of the View (B &C) use the CDC object and continue the printing. Please let me know if thats the right way to do or if there is a better way. Also how do I print across pages. Thanks for your help.

    J 1 Reply Last reply
    0
    • S suzie100

      Hi, I am a newbiew to .NET, MFC and Visual C++. I have multiple Views (Say View A, B and C), and a Document in my Design. On the Print and Print Preview I need to print information from all the views. Currently I have overloaded the OnPrint() function in View A. After View A 's print is done, how do I get it to Print View B and View C's Data. Should I post a Message to View B and C passing the CDC object, and each of the View (B &C) use the CDC object and continue the printing. Please let me know if thats the right way to do or if there is a better way. Also how do I print across pages. Thanks for your help.

      J Offline
      J Offline
      Jano Petras
      wrote on last edited by
      #2

      Certainly you could pass a message with CDC as parameter - or create custom class to do printing and from the OnPrint method in one of the views create an array of pointers to all other views and pass this as a parameter to your print method that would then print all of them. As per printing accross pages - done it few times and always a headache. One of the better techniques I used was clipping rectangles (per page) and moving CDC drawing origin according to the page being printed. I think this worked the best for me. Good luck :) Regards JP

      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