Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IOleClientSite::GetContainer method

Retrieves a pointer to the object's container.

Syntax


HRESULT GetContainer(
  [out]  IOleContainer **ppContainer
);

Parameters

ppContainer [out]

Address of IOleContainer pointer variable that receives the interface pointer to the container object. If an error occurs, the implementation must set ppContainer to NULL.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return codeDescription
OLE_E_NOT_SUPPORTED

The client site is in an OLE 1 container.

E_NOINTERFACE

The container does not implement the IOleContainer interface.

 

Remarks

If a container supports links to its embedded objects, implementing GetContainer enables link clients to enumerate the container's objects and recursively traverse a containment hierarchy. This method is optional but recommended for all containers that expect to support links to their embedded objects.

Link clients can traverse a hierarchy of compound-document objects by recursively calling GetContainer to get a pointer to the link source's container; followed by QueryInterface to get a pointer to the container's IOleObject interface and, finally, IOleObject::GetClientSite to get the container's client site in its container.

Simple containers that do not support links to their embedded objects probably do not need to implement this method. Instead, they can return E_NOINTERFACE and set ppContainer to NULL.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OleIdl.h

IDL

OleIdl.Idl

IID

IID_IOleClientSite is defined as 00000118-0000-0000-C000-000000000046

See also

IOleClientSite

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.