×

Discussion Board

Results 1 to 3 of 3

Thread: MTM Store

  1. #1
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    107

    MTM Store

    What's wrong with the following:

    Assume that I have a valid entry ID in iEntryId.

    CMsvEntry* serverEntry = CMsvEntry::NewL(*iSession, iEntryId,
    TMsvSelectionOrdering());
    CleanupStack::PushL(serverEntry);
    TMsvEntry entry = serverEntry->Entry();

    CParaFormatLayer* paraLayer = CParaFormatLayer::NewL();
    CleanupStack::PushL(paraLayer);
    CCharFormatLayer* charLayer = CCharFormatLayer::NewL();
    CleanupStack::PushL(charLayer);
    CRichText* body = CRichText::NewL(paraLayer, charLayer);
    CleanupStack::PushL(body);

    CMsvStore* writeStore = serverEntry->EditStoreL();
    CleanupStack::PushL(writeStore);

    body->InsertL(0, _L("Some body text"));
    entry.iDescription.Set(body->Read(0));

    writeStore->StoreBodyTextL(*body);
    serverEntry->ChangeL(entry);

    TBool hasStore = serverEntry->HasStoreL(); // hasStore will hold EFalse.
    Why?

    CleanupStack::PopAndDestroy(5, serverEntry); // writeStore, body,
    charLayer, paraLayer, serverEntry

    Thank you,
    Sammy

  2. #2
    Registered User
    Join Date
    Apr 2005
    Posts
    5
    I think you you need to commit the store before to check if it has a body stored

  3. #3
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    107
    Thank you, that was it!

Posting Permissions

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