This section explains how to install MTMs during build time to include them in ROM and how to install MTMs at run time on to a target phone (not in ROM).
To install an MTM during build time, complete the following steps:
Build the MTM DLLs to a \sys\bin directory on any drive. For example, c:\sys\bin.
Build the MTM resource file to resource\messaging\mtm.
Example
// mtm.mmp /** @file @SYMPurpose mtm.dll */ TARGET mtm.dll TARGETTYPE dll TARGETPATH sys/bin CAPABILITY ReadDeviceData WriteDevicedata UID 0x1000008d 0x10204286 VENDORID 0x70000001 SOURCEPATH ../src USERINCLUDE ../inc SYSTEMINCLUDE /epoc32/include LIBRARY euser.lib LIBRARY msgs.lib LIBRARY bafl.lib LIBRARY efsrv.lib SOURCEPATH . start resource mtm.rss TARGET mtm.rsc TARGETPATH resource/messaging/mtm end
After creating a group of MTMs, you have to write an MTM installation application to install and register the MTMs with the Message Server using the MTM resource file. A program to do this would typically be run at the end of installation.
Procedure
To install an MTM at run time on to a target phone, complete the following steps:
Create a session with the Message Server using the CMsvSession class.
Call CMsvSession::InstallMtmGroup() to install a new group of MTMs.
Result: The CMsvSession::InstallMtmGroup() function notifies the Message Server about the availability of a new MTM. When this is done, all running client processes are also notified about the availability of a new MTM.
// Creating a Message Server session CDummyObserver ob; iSession=CMsvSession::OpenSyncL(ob); CleanupStack::PushL(iSession); //Install an MTM using a resource file iSession->InstallMtmGroup(ResourceFileName);
To remove an MTM, call the CMsvSession::DeInstallMtmGroup() function.
Result: The CMsvSession::DeInstallMtmGroup() function dynamically notifies the running client processes about the non-availability of the MTM.