IMAPIFormFactory::CreateClassFactory

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Returns a class factory object for the form.

HRESULT CreateClassFactory(
  REFCLSID clsidForm,
  ULONG ulFlags,
  LPCLASSFACTORY FAR * lppClassFactory
);

Parameters

  • clsidForm
    [in] A class identifier for the form to be created by the class factory.

  • ulFlags
    [in] Reserved; must be zero.

  • lppClassFactory
    [out] A pointer to the class factory object.

Return Value

  • S_OK
    The class factory object was returned.

Remarks

Form viewers call the IMAPIFormFactory::CreateClassFactory method to obtain a class factory for a specific form. The class factory is used to create instances of a form that handles messages of a specific class and to control the access to these instances.

The CreateClassFactory method is called by form viewers to obtain a class factory object for form servers that implement multiple message classes. This method receives a class identifier (CLSID) as a parameter. Based on that parameter, this method can determine the specific kind of class factory object to return.

Notes to Implementers

You can return from your CreateClassFactory implementation the same class factory object on multiple calls for the same class identifier. Creating a new class factory instance is not required.

You can have a single class factory implementation that creates appropriate class factory instances on demand, or multiple class factory implementations, one for each message class.

See Also

Reference

IMAPIFormFactory : IUnknown