To update the example code so that it behaves differently from only using half of the page like you're seeing, look at this section of the code in OnPrintBestFit:
if (bResizeGraph) {
// create a rectangle to resize the graph to (on the screen)
CRect rcNew;
rcNew.left = 0;
rcNew.top = 0;
rcNew.right = (long)(cInchesWide * logicalPixelsPerInchX_Screen);
rcNew.bottom = (long)(cInchesTall * logicalPixelsPerInchY_Screen);
// resize the graph so it will render larger (with more detail)
// the FALSE tells it to not redraw
m_Graph.MoveWindow(rcNew, FALSE);
}
// Calculate a rectangle (in printer coordinates) to print the
// graph in.
rc.left = 0;
rc.top = 0
;
rc.right = (long)(cInchesWide * logicalPixelsPerInchX_Printer);
rc.bottom = (long)(cInchesTall * logicalPixelsPerInchY_Printer);
Adjust the calculation for the rcNew.bottom and rc.bottom according to what you want.
- Elton