Namespaces
Variants
Actions

How can I tell if a messaging module (MTM) is connected?

Jump to: navigation, search



Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition

Article
Created: User:Technical writer 2 (20 Aug 2007)
Last edited: hamishwillee (14 Jun 2012)

Overview

How can I tell if a messaging module (MTM) is connected?

Description

Examine via the messaging server to find out whether an MTM is used or not.
Normally client applications do not need to know whether an MTM module is connected to the server or not. The server automatically loads and unloads them when needed, and there is no direct function for inquiring such information. However, you can use the CClientMtmRegistry class to inquire if an MTM module is used or not. This would be the same as if an MTM is connected to the server or not.

Solution

First, open a client session with the message server:
CMsvSession* session = CMsvSession::OpenAsyncL(*this);
Then create an object of the CClientMtmRegistry class:
CClientMtmRegistry* mtmReg;
mtmReg = CClientMtmRegistry::NewL(*session);
/* list of known MTM Uid
KUidMsgTypeSMS
KUidMsgTypeMultimedia
KUidMsgTypePOP3
KUidMsgTypeIMAP4
KUidMsgTypeSMTP

  • /
    if (mtmReg->IsPresent(KUidMsgTypePOP3))
    {
    // POP3 MTM is present
    }
    if (mtmReg->IsInUse(KUidMsgTypePOP3))
    {
    // POP3 MTM is in use
    }
    If the UID of an MTM is unknown, run the following loop to get it.
    TInt mtmCount = mtmReg->NumRegisteredMtmDlls();
    for (TInt i=0; i<mtmCount; i++)
        {
        TUid mtmUid = mtmReg->MtmTypeUid(i);
        const CMtmDllInfo* mtmInfo;
        mtmInfo = &(iMtmReg->RegisteredMtmDllInfo(mtmUid));
        TBuf8<256> info;
        info.Copy(mtmInfo->HumanReadableName());
        }
This page was last modified on 14 June 2012, at 09:04.
86 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved