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 |
); |
Parameters
Return Values
This method supports the standard return value E_OUTOFMEMORY, as well as the following:
Remarks
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.
See Also