Export (0) Print
Expand All

CDocObjectServer::OnApplyViewState 

Override this function to restore the state of the DocObject view.


virtual void OnApplyViewState(
   CArchive& ar 
);

Parameters

ar

A CArchive object from which to serialize the view state.

This function is called when the view is being displayed for the first time after its instantiation. OnApplyViewState instructs a view to reinitialize itself according to the data in the CArchive object previously saved with OnSaveViewState. The view must validate the data in the CArchive object because the container does not attempt to interpret the view state data in any way.

You can use OnSaveViewState to store persistent information specific to your view's state. If you override OnSaveViewState to store information, you will want to override OnApplyViewState to read that information and apply it to your view when it is newly activated.

Community Additions

ADD
Show:
© 2014 Microsoft