Platform SDK: MAPI

IMAPIFormContainer::InstallForm

The IMAPIFormContainer::InstallForm method installs a form into a form library.

Quick Info

See IMAPIFormContainer : IUnknown.

HRESULT InstallForm(
  ULONG ulUIParam,       
  ULONG ulFlags,         
  LPCTSTR szCfgPathName  
);
 

Parameters

ulUIParam
[in] Handle of the parent window for any dialog boxes or windows this method displays. The ulUIParam parameter is ignored unless the client application sets the MAPI_DIALOG flag in the ulFlags parameter. The ulUIParam parameter can be NULL if MAPI_DIALOG is not also passed.
ulFlags
[in] Bitmask of flags that controls the installation of the form. The following flags can be set:
MAPI_DIALOG
Displays a dialog box to provide progress information or prompt the user for additional information. If this flag is not set, no dialog box is displayed.
MAPI_UNICODE
The passed-in strings are in Unicode format. If the MAPI_UNICODE flag is not set, the strings are in ANSI format.
MAPIFORM_INSTALL_OVERWRITEONCONFLICT
If another form already exists that handles the message class handled by this form, then replace the existing form with this one. This flag is ignored if the MAPI_DIALOG flag is also present.
szCfgPathName
[in] Path to the form's configuration file.

Return Values

S_OK
The call succeeded and has returned the expected value or values.
MAPI_E_EXTENDED_ERROR
An implementation error occurred; to get the MAPIERROR structure associated with the error, call the IMAPIFormContainer::GetLastError method.
MAPI_E_USER_CANCEL
The user canceled the installation of the form, typically by clicking the Cancel button in a dialog box.

Notes to Implementers

Form library providers should fill in a MAPIERROR structure and return MAPI_E_EXTENDED_ERROR if any of the following conditions occur:

Notes to Callers

Client applications call the IMAPIFormContainer::InstallForm method to install a form into a specific form container. The szCfgPathName parameter must contain the path of a form configuration file — that is, a file with the .CFG extension — that describes the form and its implementation. The flags in the ulFlags parameter specify:

Clients should call IMAPIFormContainer::GetLastError if InstallForm returns MAPI_E_EXTENDED_ERROR and should check the returned MAPIERROR structure to determine the condition causing the error.