IMAPIFormFactory::CreateClassFactory

The IMAPIFormFactory::CreateClassFactory method returns a class factory object for the form.

Quick Info

See IMAPIFormFactory : IUnknown.

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

Parameters

clsidForm
[in] Class identifier for the form to be created by the class factory.
ulFlags
Reserved; must be zero.
lppClassFactory
[out] Pointer to the class factory object.

Return Values

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.