Export (0) Print
Expand All

IOleItemContainer::GetObjectStorage method

Retrieves a pointer to the storage for the specified object.

Syntax


HRESULT GetObjectStorage(
  [in]   LPOLESTR pszItem,
  [in]   IBindCtx *pbc,
  [in]   REFIID riid,
  [out]  void **ppvStorage
);

Parameters

pszItem [in]

The compound document's name for the object whose storage is requested.

pbc [in]

A pointer to the IBindCtx interface on the bind context to be used in this binding operation. The bind context caches objects bound during the binding process, contains parameters that apply to all operations using the bind context, and provides the means by which the binding implementation should retrieve information about its environment.

riid [in]

A reference to the identifier of the interface to be used to communicate with the object, usually IStorage.

ppvStorage [out]

Address of a pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvStorage contains the requested interface pointer to the storage for the object named by pszItem. When successful, the implementation must call AddRef on *ppvStorage; it is the caller's responsibility to call Release. If an error occurs, *ppvStorage is set to NULL.

Return value

This method can return the standard return value E_OUTOFMEMORY, as well as the following values.

Return codeDescription
S_OK

The method completely successfully.

MK_E_OBJECT

The parameter pszItem does not identify a object in this container.

MK_E_NOSTORAGE

The object does not have its own independent storage.

E_NOINTERFACE

The requested interface is not available.

 

Remarks

The item moniker implementation of IMoniker::BindToStorage calls this method.

Notes to Implementers

If pszItem designates a pseudo-object, your implementation of IOleItemContainer::GetObjectStorage should return MK_E_NOSTORAGE, because pseudo-objects do not have their own independent storage. If pszItem designates an embedded object, or a portion of the document that has its own storage, your implementation should return the specified interface pointer on the appropriate storage object.

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_IOleItemContainer is defined as 0000011c-0000-0000-C000-000000000046

See also

IOleItemContainer

 

 

Community Additions

ADD
Show:
© 2014 Microsoft