Contents Index Topic Contents | ||
Previous Topic: IOleDocument::CreateView Next Topic: IOleDocument::GetDocMiscStatus |
IOleDocument::EnumViews
HRESULT EnumViews( IEnumOleDocumentViews ** ppEnum, IOleDocumentView ** ppView );Creates an object that enumerates the views supported by an Active Document, or, if only one view is supported, returns a pointer to that view.
- Returns one the following values:
S_OK If the object supports multiple views, ppEnum contains a pointer to the enumerator object and the content of ppView is NULL. Otherwise, the content of ppEnum is NULL and ppView contains an interface pointer to the single view. E_OUTOFMEMORY There is not enough memory available to create the object. E_POINTER Either ppEnum or ppView is invalid. The caller must pass valid pointers for both parameters.
- ppEnum
- [out] Address of the IEnumOleDocumentViews interface pointer on the enumerator object.
- ppView
- [out] Address of the IOleDocumentView interface on a single view object.
If an Active Document supports multiple views of its data, it must also implement IEnumOleDocumentViews and place that interface's pointer in ppEnum. Using this pointer, the container can enumerate the views supported by the Active Document.
If the Active Document supports only a single view, IOleDocument::EnumViews places that view's IOleDocumentView pointer in ppView.
Notes to Callers
Call this method to determine if an Active Document 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 Active Documents; E_NOTIMPL is not an acceptable return value.
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.