This page was last modified 09:51, 24 August 2007.
TSS000173 - How can I tell if a messaging module (MTM) is connected?
From Forum Nokia Wiki
Subject:
| How can I tell if a messaging module (MTM) is connected?
| TSS000173
|
| Platform(s):
| Device(s), SW version(s):
|
S60 1st Edition S60 2nd Edition
| N/A
|
Category:
| Symbian C++
|
Subcategory:
| Messaging
|
Description:
| Overview 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()); }
|