IOleDocument::EnumViews

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.

HRESULT EnumViews(
  IEnumOleDocumentViews ** ppEnum,
                              //Address of output variable that 
                              // receives the IEnumOleDocumentViews 
                              // interface pointer
  IOleDocumentView ** ppView  //Address of output variable that 
                              // receives the IOleDocumentView 
                              // interface pointer
);
 

Parameters

ppEnum
[out] Address of IEnumOleDocumentViews* pointer variable that receives the interface pointer to the enumerator object.
ppView
[out] Address of IOleDocumentView* pointer variable that receives the interface pointer to a single view object.

Return Value

This method supports the standard return value E_OUTOFMEMORY, as well as the following:

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.
E_POINTER
The address in ppEnum or ppView is invalid. The caller must pass valid pointers for both arguments.

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.

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 Release.

Notes to Implementers

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

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in docobj.h.

See Also

IEnumOleDocumentViews, IOleDocumentView