Share via


IMAPIFormMgr::CreateForm

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Opens a form to create a new message based on the form's message class.

HRESULT CreateForm(
  ULONG_PTR ulUIParam,
  ULONG ulFlags,
  IMAPIFormInfo pfrminfoToActivate,
  REFIID refiidToAsk,
  LPVOID FAR * ppvObj
);

Parameters

  • ulUIParam
    [in] A handle to the parent window for the progress indicator that is displayed while the form is opened. The ulUIParam parameter is ignored unless the MAPI_DIALOG flag is set in the ulFlags parameter.

  • ulFlags
    [in] A bitmask of flags that controls how the form is opened. The following flag can be set:

    • MAPI_DIALOG
      Displays a user interface to provide status or prompt the user for more information. If this flag is not set, no user interface is displayed.
  • pfrminfoToActivate
    [in] A pointer to the form information object that is used to open the form.

  • refiidToAsk
    [in] A pointer to the interface identifier (IID) for the interface to be returned for the form object that was created. The refiidToAsk parameter must not be NULL.

  • ppvObj
    [out] A pointer to a pointer to the returned interface.

Return Value

  • S_OK
    The call succeeded and has returned the expected value or values.

  • MAPI_E_NO_INTERFACE
    The requested interface is not supported by the form object.

Remarks

Form viewers call the IMAPIFormMgr::CreateForm method to open a form to create a new message based on the form's message class. CreateForm opens the form by creating an instance of the form server for that form as described in the given form information object. If required, CreateForm calls the IMAPIFormMgr::PrepareForm method to download the form server code to the user's disk.

The pfrminfoToActivate parameter must point to a form information object that has been correctly resolved.

After the form has been opened, the calling form viewer must set up a message by using the IPersistMessage interface and can optionally set up a view context for the form. For more information, see Launching a Form Server.

MFCMAPI Reference

For MFCMAPI sample code, see the following table.

File

Function

Comment

MAPIFormFunctions.cpp

CreateAndDisplayNewMailInFolder

MFCMAPI uses the IMAPIFormMgr::CreateForm method to create a form before displaying it.

See Also

Reference

IMAPIFormMgr::PrepareForm

IPersistMessage : IUnknown

IMAPIFormMgr : IUnknown

Concepts

MFCMAPI as a Code Sample

Launching a Form Server