×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    6

    How to create a wappush sms in the inbox

    I'll create a wappush sms in the inbox,and i could create the general sms successful with the following code:

    void CSmsMonitorEngine::CreateNewMessageL(const TDesC& aAddr, const TDesC& aContent)
    {
    const TInt LEN = 12;

    //================================================================
    //
    //================================================================
    iSmsMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId); //test!

    TMsvEntry newIndexEntry;
    newIndexEntry.iDate.HomeTime();
    //
    newIndexEntry.SetInPreparation(ETrue);
    // This is an SMS message
    newIndexEntry.iMtm = KUidMsgTypeSMS;
    newIndexEntry.iType = KUidMsvMessageEntry;

    newIndexEntry.iDetails.Set(aAddr);
    newIndexEntry.iDescription.Set(aContent.Left(LEN));

    newIndexEntry.SetSendingState(KMsvSendStateNotApplicable);
    newIndexEntry.SetUnread(ETrue);
    newIndexEntry.SetNew(ETrue);

    //in 3rd edition crashes here if capabilities are wrong
    newIndexEntry.iServiceId = iSmsMtm->ServiceId();

    //pID = (TInt*)&newIndexEntry;
    //*(pID+2) = 0x120021;
    iSmsMtm->Entry().CreateL(newIndexEntry);

    TMsvId smsId = newIndexEntry.Id();
    iSmsMtm->SwitchCurrentEntryL(smsId);
    iSmsMtm->Entry().ChangeL(newIndexEntry);
    iSmsMtm->SaveMessageL();

    /*--------------------------------------------
    // header
    //------------------------------------------*/
    CRichText* richText = CRichText::NewL(CEikonEnv::Static()->SystemParaFormatLayerL(), CEikonEnv::Static()->SystemCharFormatLayerL());
    CleanupStack::PushL(richText);
    richText->InsertL(0, aContent);

    CSmsHeader* mySmsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*richText);
    CleanupStack::PushL(mySmsHeader);

    CMsvEntry* tmpEntry = iMsvSession->GetEntryL(newIndexEntry.Id());
    CleanupStack::PushL(tmpEntry);
    if ( tmpEntry->HasStoreL() )
    {
    mySmsHeader->SetFromAddressL(aAddr);

    CMsvStore* store = tmpEntry->EditStoreL();
    CleanupStack::PushL(store);

    //
    CSmsDeliver& deliver = mySmsHeader->Deliver();
    TTime nowTime;
    nowTime.HomeTime();
    deliver.SetServiceCenterTimeStamp(nowTime);

    mySmsHeader->StoreL(*store);
    store->StoreBodyTextL(*richText);

    store->CommitL();
    CleanupStack::PopAndDestroy(store);
    }


    TMsvEntry tttEntry = iSmsMtm->Entry().Entry();
    //
    tttEntry.SetInPreparation(EFalse);
    //
    tttEntry.SetReadOnly(ETrue);

    iSmsMtm->Entry().ChangeL(tttEntry);
    CleanupStack::PopAndDestroy(3, richText); // tmpEntry, mySmsHeader, richText

    //delete iSmsMtm;
    //iSmsMtm = NULL;
    //delete iMtmRegistry;
    //iMtmRegistry = NULL;
    //delete iMsvSession;
    //iMsvSession = NULL;

    return;
    }
    then i change the line "newIndexEntry.iMtm = KUidMsgTypeSMS;" to "newIndexEntry.iMtm = KUidMtmWapPush;",then the program could create a sms in inbox(looks like a wappush in the list), but when i open it ,it crashed,and prompt an error with "PushMtmUI 14",i don't know what dose it mean,could anybody could help me?

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

    Re: How to create a wappush sms in the inbox

    You should not multipost, or at least you should wait longer than 24 hours before having a new thread with excatly same question: http://discussion.forum.nokia.com/fo...d.php?t=182296

Similar Threads

  1. Replies: 3
    Last Post: 2010-12-27, 10:47
  2. How to read SMS via Socket and get into inbox
    By juannoguera in forum Symbian Networking & Messaging (Closed)
    Replies: 14
    Last Post: 2009-10-23, 04:10
  3. Create a new entry in sms inbox
    By prassaschr in forum Symbian
    Replies: 4
    Last Post: 2008-11-13, 03:58
  4. Create a new entry in sms inbox
    By prassaschr in forum Symbian
    Replies: 3
    Last Post: 2008-11-06, 12:33
  5. Can we create our own Inbox for sms?
    By ronaldwh in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-05-07, 10:30

Posting Permissions

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