Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


Called by the framework to retrieve the size, in HIMETRIC units, of the OLE item.

virtual BOOL OnGetExtent(
   DVASPECT nDrawAspect,
   CSize& rSize 



Specifies the aspect of the OLE item whose bounds are to be retrieved. This parameter can have any of the following values:

  • DVASPECT_CONTENT   Item is represented in such a way that it can be displayed as an embedded object inside its container.

  • DVASPECT_THUMBNAIL   Item is rendered in a "thumbnail" representation so that it can be displayed in a browsing tool.

  • DVASPECT_ICON   Item is represented by an icon.

  • DVASPECT_DOCPRINT   Item is represented as if it were printed using the Print command from the File menu.


Reference to a CSize object that will receive the size of the OLE item.

Nonzero if successful; otherwise 0.

If the container application was written with the Microsoft Foundation Class Library, this function is called when the GetExtent member function of the corresponding COleClientItem object is called. The default implementation does nothing. You must implement it yourself. Override this function if you want to perform special processing when handling a request for the size of the OLE item.

Community Additions

© 2015 Microsoft