When the container application asks the server to render the document, the server invokes the virtual OnDraw() method in the COleServerItem class. The COleServerItem::OnDraw() takes a device context and a size parameter, and the device context is typically a metafile DC. The viewport contains a DrawMetafile() method that draws the contents of the model to a metafile. The DrawMetafile() method excludes the grid, page boundary lines, and selection handles from being drawn, since these are artifacts used to edit objects on the canvas.
BOOL CMyAppSrvrItem::OnDraw(CDC* pDC, CSize& rSize) { // Remove this if you use rSize UNREFERENCED_PARAMETER(rSize); // // Draw the viewport onto the metafile DC // CMyAppViewport* pViewport = GetViewport(); if (pViewport != NULL) { pDC->SetMapMode(MM_TEXT); pViewport->DrawMetafile(pDC); pDC->SetWindowExt(1,1); } return TRUE; } |
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.