×

Discussion Board

Results 1 to 4 of 4

Thread: reading SMS

  1. #1
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    80

    reading SMS

    hi,


    i want to read the sms from myfolder and write them into a txt file, i am able to read the sms from the myfolder, but myfolder also having the tamplate, when my application read the tamplate it gives the error.
    can i read the tamplate? if yes or no please give reasion.

    Thanks
    vickey

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: reading SMS

    What is the error ?
    And how is the code ?
    Which line on it is giving the error ?

  3. #3
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    80

    Re: reading SMS

    void CSmsHandler::ReadInbox(TMsvId aFolderId)
    {
    TBuf16<400> SMSContent; // To store the body part of SMS

    TMsvSelectionOrdering sort;

    // we want to handle also the invisible entries
    sort.SetShowInvisibleEntries(ETrue);

    // Reading Messages from Inbox Folder
    CMsvEntry* inboxContext=CMsvEntry::NewL(*iSession,aFolderId,sort);
    CleanupStack::PushL(inboxContext);

    CMsvEntrySelection* entries = inboxContext->ChildrenL();
    CleanupStack::PushL( entries );
    AccessMtmL();

    TInt msgCount= entries->Count();
    for (TInt i=0; i<entries->Count(); i++)
    {

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

    CMsvEntry* entry= iSession->GetEntryL((*entries)[i]);
    CleanupStack::PushL(entry);

    TMsvEntry entry1 = entry->Entry();

    CMsvStore* inboxStore = NULL;
    inboxStore= entry->ReadStoreL();
    CleanupStack::PushL(inboxStore);
    if (inboxStore->HasBodyTextL())
    {

    TBufC<100> aText(entry1.iDetails); // Gives you phone Number
    TTime aTime = entry1.iDate;
    TInt aSize = entry1.iSize;
    TUid aId = entry1.iType;
    TBuf8<100> msg;
    msg.Copy(aText);
    const TInt iDetailLength = msg.Length();

    CRichText& richText= iSmsMtm->Body();
    inboxStore->RestoreBodyTextL(richText);
    const TInt length = richText.DocumentLength();

    SMSContent.Copy(richText.Read(0,length)); // Gives you actual content(Body) of SMS
    richText.Reset();


    TBuf8<400> SMSContent8;
    SMSContent8.Append(msg);
    SMSContent8.Append(_L8("\r\n"));
    SMSContent8.Append(SMSContent);
    SMSContent8.Append(_L8("\r\n"));

    WriteToFile(SMSContent8); // Write SMS Body in the SMSBody.txt file
    }
    else
    {
    // no text in SMS
    }
    CleanupStack::PopAndDestroy(inboxStore);
    CleanupStack::PopAndDestroy(entry);
    }
    CleanupStack::PopAndDestroy(entries);
    CleanupStack::PopAndDestroy(inboxContext);
    }









    inboxStore= entry->ReadStoreL();

    abhove line is giving the error when template is come.
    and the error is E32USER-CBase 71

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: reading SMS

    SDK says to E32User CBase 71 that "This panic is raised when TRAPs have been nested and an attempt is made to exit from a TRAP nest level before all the cleanup items belonging to that level have been popped off the cleanup stack."

    So re-check all CleanupStack::PushL() and functions having LC, and make sure you Pop() all out in right order and before leaving the function.

Similar Threads

  1. Reading SMS in Port 50000 Nokia 6275 CDMA
    By pmramprasath in forum Mobile Java General
    Replies: 14
    Last Post: 2009-01-07, 14:04
  2. reading sms from the sms application
    By hatwarbabu in forum General Messaging
    Replies: 6
    Last Post: 2007-03-22, 19:40
  3. problem in reading sms index
    By hosam2010 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2005-06-12, 17:39
  4. reading and replying to sms automatically
    By dgobin in forum Symbian Networking & Messaging (Closed)
    Replies: 11
    Last Post: 2003-05-22, 16:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×