IOleDocumentView::SaveViewState method

Saves the view state into the specified stream.

Syntax


HRESULT SaveViewState(
  [in] LPSTREAM pstm
);

Parameters

pstm [in]

A pointer to the stream in which the view is to save its state data.

Return value

This method returns S_OK on success. Other possible return values include the following.

Return codeDescription
E_POINTER

The value in pstm is NULL.

E_NOTIMPL

This view has no meaningful state to save. This error should be rare because most views have at least some state information worth saving.

 

Remarks

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 IOleDocumentView::ApplyViewState.

According to the rules governing IPersistStream, a view must write its 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.

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_IOleDocumentView is defined as b722bcc6-4e68-101b-a2bc-00aa00404770

See also

IOleDocumentView
IOleDocumentView::ApplyViewState
IPersistStream

 

 

Show: