Retrieves a running object's current display size.
HRESULT GetExtent( DWORD dwDrawAspect, SIZEL *psizel );
The aspect of the object whose limit is to be retrieved; the value is obtained from the enumerations DVASPECT and from DVASPECT2. Note that newer objects and containers that support optimized drawing interfaces support the DVASPECT2 enumeration values. Older objects and containers that do not support optimized drawing interfaces may not support DVASPECT2. The most common value for this method is DVASPECT_CONTENT, which specifies a full rendering of the object within its container.
Pointer to where the object's size is to be returned.
This method returns S_OK on success. Other possible return values include the following.
||The supplied dwDrawAspect value is invalid.|
A container calls IOleObject::GetExtent on a running object to retrieve its current display size. If the container can accommodate that size, it will normally do so because the object, after all, knows what size it should be better than the container does. A container normally makes this call as part of initializing an object.
The display size returned by IOleObject::GetExtent may differ from the size last set by IOleObject::SetExtent because the latter method dictates the object's display space at the time the method is called but does not necessarily change the object's native size, as determined by its application.
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.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|