First of all, thank you for your comments. They have make me notice some things I can improve in my code :)
theCPkid wrote:
the standard DoPreparePrinting code as it provides better error checking like what if CreatePrinterDC fails? your funciton will still return TRUE but not so in case of standard code.
Yes, you are right, but you can add that error checking all the security you want/need before returning TRUE. (I will change it)
theCPkid wrote:
but if you deleting the print dialog at beginning, then wont the settings entered by user in print setup box will be lost?
No. You are right, I am deleting the standard CPrintDialog, but changing it with my CDlgPrinting that is derivation of it (I actually made a copy of the standard and modified it to fit my needs), so it has the support for print-setup as well.
theCPkid wrote:
Say, you select A4 size in print setup box and when you go to print->properties, will it show A4 size selected or default size, probably letter selected?
The trick is that I have no "print setup" in the main frame menu, it has to be made through my dialog if you don't want to print with the standards (A4, portrait, black and white). I made a test in a plotter and it was successfull with A4 and A3, I don't allow smaller pages because of my application's workspace. I print graphics, tables and other things, needed info wouldn't fit otherwise or, I have to zoom it out it would be too small to be clearly understood. But I restrict some setup because of depending on where is being printed it "must" be printed with some specifical configuration, so I give it "manually" in the code of the view.
theCPkid wrote:
Just adjusting the font size etc accordingly whether we are in print preview mode or displaying on monitor or sending to printer.
Why? I am using the same font for both and it works good. I create them with:
CFont fontLabels, fontInfo;
fontLabels.CreatePointFont (80, "MS Sans Serif", pDC);
fontInfo.CreatePointFont (140, "MS Sans Serif", pDC);
theCPkid wrote:
And dmPaperLength and dmPaperWidth were always zero although dmPaperSize was changing properly. I initially thought of storing length, width in a table but that would have been very very and very tedious.