Export (0) Print
Expand All

IOleDocument::EnumViews method

Creates an object that enumerates the views supported by a document object, or if only one view is supported, returns a pointer to that view.

Syntax


HRESULT EnumViews(
  [out]  IEnumOleDocumentViews **ppEnum,
  [out]  IOleDocumentView **ppView
);

Parameters

ppEnum [out]

A pointer to an IEnumOleDocumentViews pointer variable that receives the interface pointer to the enumerator object.

ppView [out]

A pointer to an IOleDocumentView pointer variable that receives the interface pointer to a single view object.

Return value

This method returns S_OK if the object supports multiple views, then ppEnum contains a pointer to the enumerator object, and ppView is NULL. Otherwise, ppEnum is NULL, and ppView contains an interface pointer on the single view.

Other possible return values include the following.

Return codeDescription
E_OUTOFMEMORY

Insufficient memory available for the operation.

E_POINTER

The address in ppEnum or ppView is invalid. The caller must pass valid pointers for both arguments.

 

Notes to Callers

Call this method to determine if a document object supports more than one view of its data. If it does, the caller can use the pointer written to ppEnum to specify which view to activate. When finished with the pointer, the caller must free it by calling IUnknown::Release.

Notes to Implementers

This method must be completely implemented on all document objects; E_NOTIMPL is not an acceptable return value.

Remarks

If a document object supports multiple views of its data, it must also implement IEnumOleDocumentViews and pass that interface's pointer in the out parameter ppEnum. Using this pointer, the container can enumerate the views supported by the document object.

If the document object supports only a single view, IOleDocument::EnumViews passes that view's IOleDocumentView pointer in the out parameter ppView.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

DocObj.h

IDL

DocObj.Idl

IID

IID_IOleDocument is defined as b722bcc5-4e68-101b-a2bc-00aa00404770

See also

IEnumOleDocumentViews
IOleDocument
IOleDocumentView

 

 

Community Additions

ADD
Show:
© 2014 Microsoft