IMAPIForm::SetViewContext
The IMAPIForm::SetViewContext
method sets a form view context as the current view context for a form.
Quick Info
See IMAPIForm
: IUnknown.
HRESULT SetViewContext(
|
LPMAPIVIEWCONTEXT pViewContext |
|
|
) |
|
Parameters
pViewContext
[in] Pointer
to the view context object to set as current.
Return Values
S_OK
The call
succeeded and has returned the expected value or values.
Remarks
Form viewers
call the IMAPIForm::SetViewContext method to set a
particular form view context as current. A typical implementation of SetViewContext
sets up a view advise sink object by calling the IMAPIViewContext::SetAdviseSink method, so that
notifications can be received for the view context, and calls the IMAPIViewContext::GetViewStatus method for the view
context to set as current to determine which status flags have been set.
A form can
have only one view context at a time. If a previous view context exists, the
implementation must call IMAPIViewContext::SetAdviseSink, passing in NULL in the pmnvs
parameter, before returning from the SetViewContext call.
The SetViewContext
implementation can also perform other actions based on the GetViewStatus
flags returned. For example, if the VCSTATUS_NEXT and VCSTATUS_PREV flags are
set, the implementation can enable Next and Previous buttons for
the view context that it sets as current.
See Also