Problem Extracting SMS Address
| Tue, 2006-04-04 11:13 | |
|
Hi!
Please help! I'm trying to extract the inbox SMS address in iMsgNumber but I don't know what is the problem because the length of the iMsgNumber is 0, and all my inbox messages have addresses. This is my code: // Create object defining grouping, ordering and if invisible // entries are included into folder entry to be retrieved TMsvSelectionOrdering order(KMsvNoGrouping, EMsvSortByNone,ETrue); // Retrieve entry representing Inbox CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession,KMsvGlobalInBoxIndexEntryId, order); //push the entry to CleanupStack CleanupStack::PushL(inboxEntry); // Get list of message entries in Inbox, folders are not included CMsvEntrySelection* selection =inboxEntry->ChildrenWithTypeL(KUidMsvMessageEntry); //push the selection to CleanupStack CleanupStack::PushL(selection); // Count the messages const TInt count(selection->Count()); //aici am modificat TInt iOKBody; TInt iOKNumber; for (TInt i = 0; i < count; i++) { // access message entry TMsvEntry messageEntry; TMsvId owningServiceId; //if there is an error Leave User::LeaveIfError(iSession->GetEntry((*selection)[count-1],owningServiceId, messageEntry)); // size of the entry is in TMsvEntry::iSize TBuf<KSMSBodyLength> iMsgBody(messageEntry.iDescription); //message address iSmsMtm->SwitchCurrentEntryL( messageEntry.Id() ); CSmsClientMtm* aSmsMtm = STATIC_CAST(CSmsClientMtm*, iSmsMtm);Â Â Â Â Â Â CSmsHeader& hdr = aSmsMtm->SmsHeader();Â Â Â Â Â Â Â TBuf<KSMSPhoneNumberLength> iMsgNumber = hdr.FromAddress(); //end end message address } |
|






Forum posts: 7
Hi try this
iSmsMtm->SwitchCurrentEntryL( aFolderID );
CMsvEntry& entry = iSmsMtm->Entry();
CMsvEntrySelection* entries = entry.ChildrenWithMtmL(KUidMsgTypeSMS);
CDesCArrayFlat* arrayAddr = new (ELeave) CDesCArrayFlat(10);
CDesCArrayFlat* arrayMsgBody = new (ELeave) CDesCArrayFlat(70);
iIdArray = new (ELeave) RArray<TMsvId>;
for (TInt i = 0; i < entries->Count(); i++ )
{
TBuf<KMessageBodySize> body;
TBuf<KMessageAddressLength> address;
if ( GetMessageIndexBodyTextL( (*entries)[i], body ) ) //
{
iIdArray->Append( (*entries)[i] );
arrayMsgBody->AppendL ( body );
// Recipient address
GetMessageAddressL( (*entries)[i], address );
arrayAddr->AppendL ( address );
}
}
Forum posts: 8
I have one more question:
Where can I find references on this two:
GetMessageIndexBodyTextL,GetMessageAddressL