Platform SDK: MAPI

IMAPIFormMgr::ResolveMessageClass

The IMAPIFormMgr::ResolveMessageClass method resolves a message class to its form within a form container and returns a form information object for that form.

Quick Info

See IMAPIFormMgr : IUnknown.

HRESULT ResolveMessageClass(
  LPCSTR szMsgClass,           
  ULONG ulFlags,               
  LPMAPIFOLDER pFolderFocus,   
  LPMAPIFORMINFO FAR * ppResult  
);
 

Parameters

szMsgClass
[in] String naming the message class being resolved.
ulFlags
[in] Bitmask of flags that controls how the message class is resolved. The following flag can be set:
MAPIFORM_EXACTMATCH
Only message class strings that are an exact match should be resolved.
pFolderFocus
[in] Pointer to the folder containing the message being resolved. The pFolderFocus parameter can be NULL.
ppResult
[out] Pointer to a pointer to a returned form information object.

Return Values

S_OK
The call succeeded and has returned the expected value or values.
MAPI_E_NOT_FOUND
The message class passed in the szMsgClass parameter does not match the message class for any form in the form library.

Remarks

Form viewers call the IMAPIFormMgr::ResolveMessageClass method to resolve a message class to its form within a form container. The form information object returned in the ppResult parameter provides further access to the properties of the form with the given message class.

Notes to Callers

To resolve a message class to a form, a form viewer passes in the name of the message class to be resolved, such as "IPM.HelpDesk.Software".To force the resolution to be exact — that is, to prevent resolution to a superclass of the message class when an exactly matching form server is not available — the MAPIFORM_EXACTMATCH flag can be passed in the ulFlags parameter. If the pFolderFocus parameter is NULL, the message-class resolution process does not search a folder container.

The order of the containers searched depends on the implementation of the form library provider. The default form library provider searches first the local container, then the folder container for the passed-in folder, the personal form container, and finally the organization container.

Message class names are always ANSI strings, never Unicode.

The class identifier for the resolved message class is returned as part of the form information object. A form viewer should not work on the assumption that the class identifier exists in the OLE library until after the form viewer has called either the IMAPIFormMgr::PrepareForm method or the IMAPIFormMgr::CreateForm method.

See Also

IMAPIFormInfo : IMAPIProp, IMAPIFormMgr::CreateForm, IMAPIFormMgr::PrepareForm