Hi All,

I am trying to write a C++ program on a S60 series 3 Nokia that extracts all of the SMS messages on the phone in the PDU mode, and to save these PDU strings to a file on the phone. For instance, to get a string looking something like: 07917283010010F5 (the start of a PDU shown on DreamFabric).

I have managed to extract the message txt in unicode without too many problems, however I am interested in getting the PDU instead of the text.

I thought that I could somehow use:

CSmsUserData &userdata = smsPDU.UserData();

To get the PDU string (such as 07917283010010F5...), but I am not sure if this is the correct method and if its possible to get it to a descriptor so I can write it to file ?

CClientMtmRegistry* MtmRegistry = CClientMtmRegistry::NewL( *session );

CSmsClientMtm* SmsMtm = STATIC_CAST(CSmsClientMtm*, MtmRegistry->NewMtmL(KUidMsgTypeSMS));
CleanupStack::PushL(SmsMtm);

CMsvEntrySelection* entries = inboxcontent->ChildrenL();
CleanupStack::PushL( entries);
TInt msgCount = entries->Count();

TMsvId entryID = entries->At(i);
SmsMtm->SwitchCurrentEntryL(entryID);
SmsMtm->LoadMessageL();

CMsvEntry* entry=session->GetEntryL((*entries)[i]);
CleanupStack::PushL(entry);
CMsvStore* inboxStore = entry->ReadStoreL();
CleanupStack::PushL(inboxStore);

if (inboxStore->HasBodyTextL())
{
CSmsHeader& header = SmsMtm->SmsHeader();
CSmsMessage& message = header.Message ();
CSmsPDU& smsPDU = message.SmsPDU();

smsPDU.SetBits7To4(TSmsDataCodingScheme::ESmsDCSTextUncompressedWithNoClassInfo);
smsPDU.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet7Bit);

CRichText& body = SmsMtm->Body();

TPtrC text( body.Read( 0 ) );

CSmsUserData &userdata = smsPDU.UserData();
}

Can anyone help me ? I would be really grateful.

Thanks