EPOC   SDK Home Glossary Indexes Previous Next Up

MtmFactoryFunctionL typedef


MtmFactoryFunctionL typedef — Client-side MTM factory

typedef CBaseMtm* MtmFactoryFunctionL(CRegisteredMtmDll&, CMsvSession&);

Defined in

mtclbase.h

Description

A concrete Client-side MTM must implement an exported factory function of this type. It should return an instance of the CBaseMtm-derived class that provides the implementation. The factory function is called by the Client-side MTM registry when a client requests this Client-side MTM.

A CBaseMtm-derived class typically provides a NewL() function, which the factory function calls.

The factory function is called by ordinal. The ordinal of the function must match that recorded in the MTM’s registry information.

Arguments

CRegisteredMtmDll& aRegisteredMtmDll

Registration data for the MTM DLL

CMsvSession&

The CMsvSession of the client requesting the object

Return value

CBaseMtm*

A newly-created instance of the CBaseMtm-derived class for the Client-side MTM.

Leave considerations

The factory function should leave if it cannot create the object.

Example

For example, a Client-side MTM whose concrete class was CEgMtm could define a suitable factory function as:

    EXPORT_C CBaseMtm* NewEgMtmL(CRegisteredMtmDll& aRegisteredMtmDll, CMsvSession& aMsvSession)
          {
          return CEgMtmUi::NewL(aRegisteredMtmDll, aMsvSession);
          }
EPOC       SDK Home Glossary Indexes Previous Next Up