Contents Index Topic Contents | ||
Previous Topic: IOleDocumentView::Open Next Topic: IOleDocumentView::SetInPlaceSite |
IOleDocumentView::SaveViewState
HRESULT SaveViewState( IStream *pstm );Saves the view state into the specified stream.
- Returns one of the following values:
S_OK Success. E_NOTIMPL This view has no meaningful state to save. E_POINTER The value in the pstm parameter is NULL.
- pstm
- [in] Address of the stream in which the view is to save its state data.
The E_NOTIMPL error should be rare because most views have at least some state information worth saving.
The view's state includes properties such as the view type, zoom factor, and location of insertion point. The container typically calls this function before deactivating the view. The stream can then later be used to reinitialize a view of the same document to this saved state through the IOleDocumentView::ApplyViewState method.
According to the rules governing the IPersistStream interface, a view must write its class identifier (CLSID) as the first element in the stream. Any cross-platform file format compatibility issues that apply to the document's storage representation also apply to this context.
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.