Share via


FormFactoryEx

Send Feedback

The FormFactoryEx function must be implemented to return a reference to the IFormProviderEx interface, which allows the Microsoft Messaging Application to create the plug-in's custom read and compose forms. The FORMFACTORYEXFUNC type defines a pointer to this function.

Note   The FormFactoryEx function is not available on Pocket PC 2002 or Smartphone 2002. For these platforms, use the FormFactory function.

Syntax

HRESULT FormFactoryEx (
  LPCWSTR pszMsgClass,
  IFormProviderEx** ppObj,
);

Parameters

  • pszMsgClass
    [in] Reference to the message's message class property.
  • ppObj
    [out] Reference to the plug-in's IFormProviderEx interface. Returns NULL if pszMsgClass is valid but the object cannot be created.

Return Values

This function returns an appropriate HRESULT value, such as the following:

  • S_OK
    The function successfully returned a reference to the IFormProviderEx interface.
  • MAPI_E_INVALID_PARAMETER
    The input parameter is NULL.
  • MAPI_E_NOT_ENOUGH_MEMORY
    A memory allocation failed.

Remarks

For a plug-in to integrate with Messaging, it must register as a separate message class with Messaging and provide custom read and compose forms for Messaging. Optionally, it can register with the WAP Push Router to be notified of binary WAP push messages.

When any type of message arrives, Messaging searches the registry for a Messaging plug-in DLL that matches the message's message class within the registry (IPM.Note for e-mail, IPM.Note.MeetingRequest for appointments, IPM.SMStext for Short Message Service (SMS), and so on). Custom message types could be created for Enhanced Messaging Service (EMS) or Multimedia Messaging Service (MMS) by a developer. Messaging loads the plug-in DLL, calling the Windows CE GetProcAddress function to get a handle to its FormFactoryEx function. Messaging calls FormFactoryEx, passing in the message class as a string, and the plug-in responds by returning a reference to its IFormProviderEx interface.

Messaging calls IFormProviderEx::CreateReadForm to read the message and calls IFormProviderEx::CreateComposeForm to compose a new message. Both methods allow the plug-in to create its own window as a child of the form frame.

When Messaging calls CreateComposeForm and CreateReadForm, it passes in a pointer to its IMessageFormHostEx interface. Messaging uses the IMessageFormEx interface pointer for communicating with the plug-in and uses the plug-in's handle (HWND) to pass on Windows messages it does not process for the plug-in.

Requirements

Pocket PC: Windows Mobile 2003 and later
Smartphone: Windows Mobile 2003 and later
OS Versions: Windows CE .NET 4.2 and later
Header: cemapi.h
Library: cemapi.lib

See Also

MAPI Functions | Messaging

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.