Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This interface is an extension to the IViewObjectinterface, which returns the size of the drawing for a given view of an object. You can prevent the object from being run if it is not already running by calling this method instead of the IOleObject::GetExtentmethod.

Like the IViewObjectinterface, IViewObject2cannot be marshaled to another process. This is because device contexts are only effective in the context of one process.

The OLE-provided default implementation provides the size of the object in the cache.

When to Implement

Object handlers and in-process servers that manage their own presentations implement IViewObject2for use by compound document containers.

When to Use

A container application or object handler calls the GetExtentmethod in the IViewObject2interface to get the object's size from its cache.

Methods

The following table shows the methods for this interface in the order that the compiler calls the methods. Like all COM interfaces, this interface inherits the methods for the IUnknowninterface.

IUnknown method Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

Method Description

Draw

Draws a representation of an object onto the specified device context.

Freeze

Freezes a certain aspect of the object's presentation so it does not change until the IViewObject::Unfreezemethod is called.

GetAdvise

Retrieves the existing advisory connection on the object if there is one and returns the parameters used in the most recent call to the IViewObject::SetAdvisemethod.

GetColorSet

Returns the logical palette the object uses for drawing in its IViewObject::Drawmethod with the corresponding parameters.

SetAdvise

Establishes a connection between the view object and an advise sink so that the advise sink can be notified about changes in the object's view.

Unfreeze

Releases a previously frozen drawing.

IViewObject2 method Description

GetExtent

Returns the size that the specified view object will be drawn on the specified target device.

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header Oleidl.h, oleidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IViewObject