IMAPIForm::ShutdownForm
The IMAPIForm::ShutdownForm
method closes a form.
Quick Info
See IMAPIForm
: IUnknown
HRESULT Close(
ULONG ulSaveOptions |
|
) |
|
Parameters
ulSaveOptions
[in] Value
that controls how or whether a form s contents are saved when the form is
closed. One of the following values can be set:
SAVEOPTS_NOSAVE
Form data
should not be saved.
SAVEOPTS_PROMPTSAVE
Prompts the
user to save data related to the form if the form has changed.
SAVEOPTS_SAVEIFDIRTY
Data related
to the form should be saved if the form has changed. If no user interface is
being displayed, the form can optionally switch to using the functionality for
the SAVEOPTS_NOSAVE option.
Return Values
S_OK
The call
succeeded and has returned the expected value or values.
Remarks
Form viewers
call the IMAPIForm::ShutdownForm method to close a form
object.
A typical
form server s implementation of ShutdownForm:
1. Calls the IUnknown::AddRef method for
the form s IPersistMessage object so it isn t released before processing
is finished.
2. Handles saving form data as indicated by the
flag set in the ulSaveOptions parameter.
3. Destroys the form s window.
4. Releases the form s subobjects.
5. Calls the IMAPIViewAdviseSink::OnShutdown method to update
notifications.
6. Calls the IMAPIViewContext::SetAdviseSink method, setting the advise
sink pointer to NULL.
7. Calls the MAPIFreeBuffer function to release the
form s properties.
8. Releases the IPersistMessage object for
which it added a reference in Step 1.
9. Releases all IMAPIMessageSite interfaces and interfaces
relating to the form viewer.
10. Returns S_OK.
Form viewers
can ignore errors returned by ShutdownForm and release the form
interface after making the call.
See Also