I'm trying to extract all BlueTooth messages with their attachments.
I'm running this in S60 v3 FP1 Emulator.
However the code crashes in trying to access the AttachmentManager.
Here's a snippet of relevant code (additional irrelevant lines removed):
Examining the contents of msgStore just before executing the problem code, - I see that the AttachmentManager is NULL (0x00000000).
CClientMtmRegistry *clientMtmReg = CClientMtmRegistry::NewL(*iMessagingSession);
CBtClientMtm* btMtm = STATIC_CAST(CBtClientMtm*, clientMtmReg->NewMtmL(KUidMsgTypeBt));
TMsvId entId = aBtMsgArray[i]; // having collected TMsvIDs of all BT messages in this array
CMsvEntry *cmsvEntry = iMessagingSession->GetEntryL(entId);
const TMsvEntry &tmsvEntry = cmsvEntry->Entry();
CMsvEntry* btEntry = iMessagingSession->GetEntryL(tmsvEntry.Id());
CMsvEntrySelection* btChildren = btEntry->ChildrenL();
if (btChildren->Count() >= 1)
TMsvId btAtt = (*btChildren);
btEntry->SetEntryL(btAtt); // switch context to CHILD entry
CMsvStore* msgStore = btEntry->ReadStoreL();
MMsvAttachmentManager& attManager = msgStore->AttachmentManagerL(); ---> Program crashes here, with System Error -25
//MMsvAttachmentManager* attManagerPtr = NULL;
//TRAP(rc, attManagerPtr = &(msgStore->AttachmentManagerL())) ; // ---->This crashes too
I've searched on these forums and came across this thread reporting a similar problem but there seems to be no resolution:
Is there a reason why the AttachmentManager is NULL? Is something wrong with the code segment above? Or is there another way to access the BT messages?
Another related question - the above code fails to compile in S60 v3 (MR) SDK. It cannot find the header file <btcmtm.h> Is this functionality not available on S60V3 ??
Thanks in advance for any help, leads and suggestions.