Partager via


IMAPIFormMgr::OpenFormContainer

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Opens an IMAPIFormContainer interface for a specific form container.

HRESULT OpenFormContainer(
  HFRMREG hfrmreg,
  LPUNKNOWN lpunk,
  LPMAPIFORMCONTAINER FAR * lppfcnt
);

Parameters

  • hfrmreg
    [in] An HFRMREG enumeration that indicates the form library to open (that is, the form container to open). An HFRMREG enumeration is an enumeration that is specific to a form library provider. Possible HFRMREG values include the following:

    • HFRMREG_DEFAULT
      A convenient form container.

    • HFRMREG_FOLDER
      A folder container.

    • HFRMREG_PERSONAL
      The container for the default message store.

    • HFRMREG_LOCAL
      A local form container.

  • lpunk
    [in] A pointer to the object for which the interface is opened. The lpunk parameter must be null unless the value for the hfrmreg parameter requires an object pointer.

  • lppfcnt
    [out] A pointer to a pointer to the returned form container object.

Return Value

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

  • MAPI_E_NO_INTERFACE
    The object pointed to by lpunk does not support the required interface.

Remarks

Form viewers call the IMAPIFormMgr::OpenFormContainer method to open an IMAPIFormContainer interface for a specific form container. This interface can then be used for installing forms into and removing forms from a form container.

Notes to Callers

If the value in hfrmreg is HFRMREG_FOLDER, the interface identifier used in lpunk must be non-null and must allow IUnknown::QueryInterface method calls to an IMAPIFolder interface.

To open the local form container, you must use a call to OpenFormContainer method or the MAPIOpenLocalFormContainer function; you cannot use the IMAPIFormMgr::SelectFormContainer method to enable the user to select the local form container.

MFCMAPI Reference

For MFCMAPI sample code, see the following table.

File

Function

Comment

MainDlg.cpp

CMainDlg::OnOpenFormContainer

MFCMAPI uses the IMAPIFormMgr::OpenFormContainer method to retrieve a form container so the container's contents can be rendered.

MsgStoreDlg.cpp

CMsgStoreDlg::OnOpenFormContainer

MFCMAPI uses the IMAPIFormMgr::OpenFormContainer method to retrieve a form container for a folder so the container's contents can be rendered.

See Also

Reference

IMAPIFormContainer::InstallForm

IMAPIFormMgr::SelectFormContainer

MAPIOpenLocalFormContainer

IMAPIFormMgr : IUnknown

Concepts

MFCMAPI as a Code Sample