How can I tell if a messaging module (MTM) is connected?
Article Metadata
Compatibility
S60 2nd Edition
Article
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());
}


(no comments yet)