IMAPIForm::DoVerb
The IMAPIForm::DoVerb
method requests a form object perform one of its verbs.
Quick Info
See IMAPIForm
: IUnknown
HRESULT DoVerb(
LONG iVerb, |
|
LPMAPIVIEWCONTEXT lpViewContext, |
|
ULONG hwndParent,
|
|
LPCRECT lprcPosRect |
|
) |
|
Parameters
iVerb
[in] Number
of the verb to be performed.
lpViewContext
[in] Pointer
to a view context object. The lpViewContext parameter can be NULL.
hwndParent
[in] Handle
of the parent window for any dialog boxes or windows this method displays. The hwndParent
parameter should be NULL if the dialog box or window is not modal.
lprcPosRect
[in] Pointer
to a Win32 RECT structure containing the current form s window size and
position.
Return Values
S_OK
The call
succeeded and has returned the expected value or values.
OLEOBJ_S_CANNOT_DOVERB_NOW
The verb is
valid, but the object cannot perform the operation now.
Remarks
Form viewers
call the IMAPIForm::DoVerb method to request an
object to perform one of its verbs. Typical form server implementations of DoVerb
contain a switch statement that tests the valid values for the iVerb
parameter.
If a
view context is passed in the lpViewContext parameter, the form must use
this view context for the duration of the verb processing rather than the view
context passed in an earlier call to the IMAPIForm::SetViewContext
method
Some verbs,
such as Print, should be modal with respect to the DoVerb call that is, the indicated operation must be finished
before the DoVerb call returns. Nonmodal verbs can be made to act as
modal verbs by passing in a view context object in lpViewContext for
which a call to the IMAPIViewContext::GetViewStatus method
The handle in
hwndParent usually remains valid throughout the DoVerb call, but
because it can be destroyed immediately upon the call s return, forms should
not save the handle.
To obtain the
RECT structure used by a form s window, call the Windows GetWindowRect
function.
See Also