Partager via


IViewObject2

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This interface is an extension to the IViewObject interface, 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::GetExtent method.

Like the IViewObject interface, IViewObject2 cannot 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 IViewObject2 for use by compound document containers.

When to Use

A container application or object handler calls the GetExtent method in the IViewObject2 interface 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 IUnknown interface.

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::Unfreeze method 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::SetAdvise method.

GetColorSet

Returns the logical palette the object uses for drawing in its IViewObject::Draw method 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