Returns the size that the specified view object will be drawn on the specified target device.
HRESULT GetExtent(
DWORD dwAspect, //View object for which the size is being
//requested
DWORD lindex, //Part of the object to draw
DVTARGETDEVICE ptd,
//Pointer to the target device in a structure
LPSIZEL lpsizel //Pointer to size of object
);
This method supports the standard return value E_OUTOFMEMORY, as well as the following:
The OLE-provided implementation of IViewObject2::GetExtent searches the cache for the size of the view object.
The GetExtent method in the IOleObject interface provides some of the same information as IViewObject2::GetExtent.
Note This method must return the same size as DVASPECT_CONTENT for all the new aspects in DVASPECT2. IOleObject::GetExtent must do the same thing.
If one of the new aspects is requested in dwAspect, this method can either fail or return the same rectangle as for the DVASPECT_CONTENT aspect.
To prevent the object from being run if it isn't already running, you can call IViewObject2::GetExtent rather than IOleObject::GetExtent to determine the size of the presentation to be drawn.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in oleidl.h.
DVASPECT, DVASPECT2, IOleObject::GetExtent, IViewObject