×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Location
    Beijing
    Posts
    363

    How to handle messages with a long content, and how to change body text

    Hi all,
    I want to change body's content of a message, but when it process the statement "CMsvStore* store = msvEntry->EditStoreL();", there will be a panic. this is my source code as below, thanks in advance.
    void CLongSms::ConjectSms()
    {
    TInt cont = iContentArray->Count();
    TBuf<450> remainedContent;
    remainedContent.Zero();
    //conject content and delete other messages
    for(TInt i(0);i<cont;i++)
    {
    remainedContent.Append((*iContentArray)[i]);
    }

    TInt pos = iEntrysLongSms->Find(iOriginalMsgid);
    iEntrysLongSms->Delete(pos);

    cont = iEntrysLongSms->Count();
    for(TInt j(0);j<cont;j++)
    {
    iSession->RemoveEntry((*iEntrysLongSms)[j]);
    }

    //TMsvId firstMsgid = (*iEntrysLongSms)[0];

    CMsvEntry* msvEntry = iSession->GetEntryL( iOriginalMsgid );
    CleanupStack::PushL( msvEntry );

    // Get the messagine store
    CMsvStore* store = msvEntry->EditStoreL();
    CleanupStack::PushL(store);

    // Construct the CRichText and restore the body text
    CParaFormatLayer* paraLayer = CParaFormatLayer::NewL();
    CleanupStack::PushL(paraLayer);
    CCharFormatLayer* charLayer = CCharFormatLayer::NewL();
    CleanupStack::PushL(charLayer);
    CRichText* body = CRichText::NewL(paraLayer, charLayer);
    CleanupStack::PushL(body);

    store->RestoreBodyTextL(*body);
    store->CommitL();
    CleanupStack::PopAndDestroy( store );

    body->DeleteL(0,body->DocumentLength());
    body->InsertL( 0, remainedContent );

    store->StoreBodyTextL(*body);

    CleanupStack::PopAndDestroy(5, msvEntry);

    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: How to handle messages with a long content, and how to change body text

    Quote Originally Posted by alei9527 View Post
    when it process the statement "CMsvStore* store = msvEntry->EditStoreL();", there will be a panic
    Do not give up: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Location
    Beijing
    Posts
    363

    Re: How to handle messages with a long content, and how to change body text

    Thanks Wizard very much for your reply.later, i changed my manner, i tried to clone the message, and restore same detailed information into a new one, but the application still crash when it run below command. At last, i got a summary that my application can not create new message or change body text of a existing one.
    iSmsMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId); //inbox

    iSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);

Posting Permissions

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