×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    102

    Difference between EMsvEntriesChanged - EMsvEntriesCreated

    Hello to all i've a question for you.
    I'm building a simple application that write on the screen if arriva sms,mms or bluettoth message.
    I'm able to write and catch these three event but why when i send from emulator a message like sms my application writes two time "SMS arrive", and when i send a mms my application writes seven time "MMS arrive"
    Below is the code:

    Code:
    void CEventKeeperContainerView::HandleSessionEventL(TMsvSessionEvent aEvent,TAny* aArg1, TAny* aArg2, TAny* aArg3)
    	{
    	switch (aEvent)
    		{
    		case EMsvServerReady:
    			{
    			CompleteConstructL();
    			break;
    			}
    		case EMsvEntriesCreated:
    			{
    			if(*(static_cast<TMsvId*>(aArg2)) == KMsvGlobalInBoxIndexEntryId)
    				{
    				CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
    				iNewMessageId = entries->At(0);
    				}
    			break;
    			}	
    		case EMsvEntriesChanged:
    			{
    			TUint contatore=0;
    			CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
    			TInt count = entries->Count();
    			while (count--!=0)
    				{
    				const TMsvId id = (*entries)[count];
    				CMsvEntry* msvEntry=iSession->GetEntryL(id);
    				CleanupStack::PushL(msvEntry);
    				if (msvEntry->Entry().iMtm == KUidMsgTypeMultimedia)
    					{
    					//MMS
    					if (contatore==0)
    						{
    						iEventKeeperContainer->WriteOnScreen(_L("Arrivato MMS"));
    						contatore++;
    						}
    					}
    				if (msvEntry->Entry().iMtm == KUidMsgTypeSMS)
    					{
    					//SMS
    					if (contatore==0)
    						{
    						iEventKeeperContainer->WriteOnScreen(_L("Arrivato SMS"));
    						contatore++;
    						
    						//Gestione testo
    						
    						//--------------
    						
    						}
    					}
    				if (msvEntry->Entry().iMtm == KUidMsgTypeBt)
    					{
    					//BlueTooth
    					if (contatore==0)
    						{
    						iEventKeeperContainer->WriteOnScreen(_L("Arrivato BT"));
    						contatore++;
    						}
    					}
    				CleanupStack::PopAndDestroy();
    				}
    			break;
    		}
    	}
    }
    And if i write my code in EmsvEntriesCreated my application write one time sms, three times MMS and two times BTMessage (i send an image).

    What is the difference.

    Thanks
    Last edited by earendil; 2008-10-01 at 16:32.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: Difference between EMsvEntriesChanged - EMsvEntriesCreated

    If you check an SMS-sending example, you will quickly find that first it creates an empty message, then adds body, recipients, and finally it changes the message (marking it visible, complete, ready for sending, etc.).
    When message arrives, the OS internally does the same thing: creates a message entry (you get a notification), then adds body, sender, etc., and finally changes the TMsvEntry once more (marking the message visible, complete, perhaps new and unread too - however those may be default settings, I do not know for sure), and you get a notification about that.

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Re: Difference between EMsvEntriesChanged - EMsvEntriesCreated

    Quote Originally Posted by earendil View Post
    And if i write my code in EmsvEntriesCreated my application write one time sms, three times MMS and two times BTMessage (i send an image).
    The main entity in Messaging is "Entry" which is stored in message server. Single message is one message entry but MMS and E-Mail can have multiple entries because they might contain attachments.

    Even messaging folders(Inbox, outbox, etc...) are stored as entries on message server.
    Nokia Developer Wiki Moderation team

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

    Re: Difference between EMsvEntriesChanged - EMsvEntriesCreated

    Hello,

    One simple solution to your problem is storing the message entry ID TMsvId and use it to check if the various cases of function HandleSessionEvent are being called for the "same message".

    Simply maintain a TMsvId variable as a member variable in your class and change its value only an actual "new" message arrives. I hope you are clear with the solution.
    Last edited by ssn.kishore; 2008-10-02 at 08:27.
    Regards,
    Sainagakishore Srikantham (Kishore)

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

Similar Threads

  1. Difference between BitBlt and DrawBitmap?
    By BO_frank in forum Symbian User Interface
    Replies: 13
    Last Post: 2008-04-24, 12:54
  2. Not getting EMsvEntriesCreated event for SMS in MDL
    By kiranpuranik in forum Symbian
    Replies: 1
    Last Post: 2006-03-01, 05:35
  3. Difference between Concept SDK and normal SDK?
    By csernap in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2004-06-08, 08:21
  4. difference between active obj and active function?
    By wudilp in forum Symbian User Interface
    Replies: 4
    Last Post: 2004-03-25, 12:16
  5. Replies: 0
    Last Post: 2004-03-20, 03: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
  •