Collapse the table of content
Expand the table of content
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. ArchiveDisclaimer


Call this function to retrieve the OLE item's size.

BOOL GetCachedExtent( 
   LPSIZE lpSize, 
   DVASPECT nDrawAspect = (DVASPECT 


Pointer to a SIZE structure or a CSize object that will receive the size information.


Specifies the aspect of the OLE item whose bounds are to be retrieved. For possible values, see SetDrawAspect.

Nonzero if successful; 0 if the OLE item is blank.

This function provides the same information as GetExtent. However, you can call GetCachedExtent to get extent information during the processing of other OLE handlers, such as OnChange. The dimensions are in MM_HIMETRIC units.

This is possible because GetCachedExtent uses the IViewObject2 interface rather than use the IOleObject interface to get the extent of this item. The IViewObject2 COM object caches the extent information used in the previous call to IViewObject::Draw.

For more information, see IViewObject2::GetExtent in the Windows SDK.

Header: afxole.h

© 2016 Microsoft