×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    17

    delete incoming message

    Hi all,
    I want to learn to cancel a message in inbox.
    This is my code
    Code:
    case EMsvEntriesCreated:
    			{
    			if(*(static_cast<TMsvId*>(aArg2)) == KMsvGlobalInBoxIndexEntryId)
    				{
    				CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
    				iNewMessageId = entries->At(0);
    				}
    			break;
    			}  
    
    
    
    case EMsvEntriesChanged:
    if (aArg2 &&  *(static_cast<TMsvId*>(aArg2)) == KMsvGlobalInBoxIndexEntryId)
    				{ 
    				CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
    				if( iNewMessageId == entries->At(0) )
    					{ 
    
    					const TMsvId id = entries->At(0);			
    					TInt uid = id;
    					CMsvEntry* msvEntry = iSession->GetEntryL(id);  //Accesses the entry with the specified ID.
    					CleanupStack:: PushL(msvEntry);
    
    
    					CleanupStack::PopAndDestroy(msvEntry);
    					}
    				}
    I Know that this code is very poor.
    What methods i need to use and add on my code?
    thank you very much

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: delete incoming message

    it is my code:
    Code:
    void DeleteEntryL(TMsvEntry& aMsvEntry)
    {
        iLogger.Write(_L("enter CSmsEngine::DeleteEntryL"));
        // Take a handle to the parent entry
        CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, aMsvEntry.Parent(), TMsvSelectionOrdering());
        CleanupStack::PushL(parentEntry);
        // here parentEntry is the Sent folder (must be so that we can call DeleteL) 
        iOperation = parentEntry->DeleteL(aMsvEntry.Id(), iStatus);
        iLogger.Write(_L("delete start"));
        CleanupStack::PopAndDestroy(parentEntry);
        SetActive();
        iLogger.Write(_L("leave CSmsEngine::DeleteEntryL"));
    }
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2008
    Posts
    333

    Re: delete incoming message

    the following code deleting message from Sent Item

    case EMsvEntriesMoved:
    {
    // Entry id is obtained from the session event arguments.
    TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 );

    // We are interested in messages that are moved to Sent Item Folder
    if ( *entryId == KMsvSentEntryId )
    {
    TMsvSelectionOrdering sort;
    sort.SetSorting(EMsvSortByDateReverse);
    sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries

    CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvSentEntryId, sort);
    CleanupStack::PushL(parentEntry);

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

    for(TInt i = 0; i < entries->Count(); i++)
    {
    if( parentEntry->ChildDataL(entries->At(i)).iMtmData3 != KUidMsgTypeSMS.iUid )
    {
    parentEntry->DeleteL(entries->At(i));
    break;
    }
    }
    CleanupStack::PopAndDestroy( entries );
    CleanupStack::PopAndDestroy( parentEntry );
    }
    break;
    }
    }

  4. #4
    Regular Contributor
    Join Date
    Feb 2008
    Location
    Pune, India
    Posts
    340

    Re: delete incoming message

    Check this link, it will help.
    Regards,
    Sainagakishore Srikantham (Kishore)

    Don't Hope, KNOW!!! ---------- Visit me at http://ssnkishore.blogspot.com ----------

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    17

    Re: delete incoming message

    Hi All,
    thank to your suggestion, i have learned a lot of new things.
    Thank you very much
    Vituperio

Similar Threads

  1. How to turn off the vibrate and sound notification for incoming message ?
    By ronaldwh in forum Symbian Networking & Messaging (Closed)
    Replies: 21
    Last Post: 2009-10-30, 15:18
  2. Bluetooth: confirmation message on incoming RFCOMM connections
    By pracucci in forum Mobile Java Networking & Messaging & Security
    Replies: 10
    Last Post: 2007-05-07, 20:09
  3. SIP: How to display incoming message details?
    By PrinceAlbertz in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-07-16, 17:06
  4. Incoming Message and Missed Call Notifications
    By amitaggarwal in forum Symbian
    Replies: 0
    Last Post: 2004-12-13, 10:16
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

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