IOleDocumentView::ApplyViewState

Asks a view to initialize itself to a previously saved state.

HRESULT ApplyViewState(
  IStream *pstm  // Pointer to stream containing state data
);
 

Parameters

pstm
[in] Pointer to a stream containing data from which the view should initialize itself.

Return Values

S_OK
The view successfully loaded its state from the specified stream.
E_POINTER
The value in pstm is NULL.
E_NOTIMPL
This view has no meaningful state to load. This error should be rare because most views will have at least some state information worth loading.

Remarks

Typically, this function is called after an existing view has been created in the container but before that view has been displayed. It is the responsibility of the view to validate the data in the view stream; the container does not attempt to interpret the view's state data.

QuickInfo

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

See Also

IOleDocument::CreateView, IOleDocumentView::SaveViewState