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