MTM Resource File

This section explains the MTM resource file format that is used for installing MTMs.

Description

You have to create and deliver an MTM resource file to register the MTM with the Message Server. The Message Server searches the ROM drive for MTM resource file on start-up and it automatically registers any MTMs found.

MTMs are represented by four DLLs on the device, which are placed in a specific directory. The system finds installed MTMs by scanning the \resource\messaging\mtm directory on all drives for resource files containing a resource of type MTM_INFO_FILE.

Important: This compiled resource file must define the MTM's properties using the resource structures MTM_INFO_FILE, MTM_CAPABILITIES and MTM_SECURITY_CAPABILITY_SET.

The MTM_INFO_FILE resource must define a MTM_COMPONENT_V2 resource for each MTM DLL for the Messaging protocol. This structure is as follows:

  • The second UID of DLL—indicates the message type or the protocol, such as SMTP, POP3, IMAP4, SMS that the MTM considers.

  • The third UID of DLL—indicates the message type or the protocol (SMTP, POP3, IMAP4, SMS) that the MTM considers.

    Note: In practice, the MTM type UID may be different for each MTM. The technology type UID may be the same for an attached group of MTMs, such as the POP and SMTP MTMs, which are separate but work together.

  • Ordinal number—indicates where the MTM component’s factory function can be found in the registered DLL.

  • Human-readable name—used to show to the user the available message types when the user has requested a Send As or a similar operation.

    Note: MTM UIDs are used to identify MTMs to the registry, but it is recommended to have meaningful (human-readable) names.

  • TVersion structure—version information, to allow updating of the MTMs by an installation program.

Note: The Message Server's CMtmDllInfo class encapsulates the registration data for an MTM and the run-time data held for a registered MTM is represented by the CRegisteredMtmDll class.

Important: The resource file must have the Server MTM DLL and Client MTM DLL information to handle various message manipulation functions in the server.

Example

The following code snippet shows the details of an MTM resource file.

// txtdat.RSS
//
// Copyright (c) 2008 Symbian Ltd.  All rights reserved.
//

#include <mtmconfig.rh>

RESOURCE MTM_INFO_FILE
    {
    mtm_type_uid = 0x100012FA;
    technology_type_uid = 0x10001626;
    components = 
        {
        MTM_COMPONENT_V2
            {
            human_readable_name = "My server dll info";
            component_uid = KUidMtmServerComponentVal;
            entry_point = 1;
            version = VERSION_V2 {};
            filename = "z:\\system\\libs\\servermtm.dll";
            },
        MTM_COMPONENT_V2
            {
            human_readable_name = "My client dll info";
            component_uid = KUidMtmClientComponentVal;
            entry_point = 1;
            version = VERSION_V2 {};
            filename = "z:\\system\\libs\\clientmtm.dll";
            },
        MTM_COMPONENT_V2
            {
            human_readable_name = "My ui dll info";
            component_uid = KUidMtmUiComponentVal;
            entry_point = 1;
            version = VERSION_V2 {};
            filename = "z:\\system\\libs\\dummyuimtm.dll"; // this does not exist
            },
        MTM_COMPONENT_V2
            {
            human_readable_name = "My ui data dll info";
            component_uid = KUidMtmUiDataComponentVal;
            entry_point = 1;
            version = VERSION_V2 {};
            filename = "z:\\system\\libs\\dummyuidatamtm.dll"; // this does not exist
            }
        };
    }
// flags to indicate that can send messages, and handle body text
RESOURCE MTM_CAPABILITIES
    {
    send_capability = 1;
    body_capability = 1;
    }

// additional capabilities required by clients of the MTM
RESOURCE MTM_SECURITY_CAPABILITY_SET
    {
    capabilities = { ECapabilityNetworkServices };
    }

Related concepts