×

Discussion Board

Results 1 to 12 of 12

Hybrid View

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    103

    How to close CMsvStore ?

    i create a message in outbox using smtpmtm ,
    SmtpMtm->CreateMessageL(TMsvId id);

    then i get the TMsvEntry from smtpmtm and set the required values in it and
    SmtpMtm->SwitchCurrentEntryL(message.Id());
    SmtpMtm->AddAddresseeL(_L("u@ok.com"));
    SmtpMtm->SetSubjectL(_L("subject"));
    SmtpMtm->SaveMessageL();
    then i get CMsvEntry& from smtpmtm as
    CMsvEntry& entry = SmtpMtm->Entry();

    on this entry object i open the store for editing ,set the richtext type message body and commit

    the store.

    entry.SetEntryL(message.iServiceId);


    NOW WORKING WITH ABOVE LINES WHILE I CHANGE THERE POSITION UP AND DOWN TO MAKE THE CODE WORK I

    GET ONE OF THE FOLLOWING ERRORS , THAT SAYS THE CMSVSTORE WAS NOT CLOSED , NOW CAN SOME ONE TELL

    ME HOW DO I CLOSE THE CMSVSTORE OBJECT.


    Category: MSGS
    251
    CMsvEntry object destroyed with associated message store left open
    259
    CMsvEntry::SetEntryL() called with associated message store left open
    261
    Client attempts to open already open message store through CMsvEntry

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    17

    Re: How to close CMsvStore ?

    Did you ever figure this out I am running into the same problem

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    30

    Re: How to close CMsvStore ?

    Hi All am also experiencing the same problem.

    Debug error:
    Main [Thread id: 748] (Suspended : Error - Thread 0x2ec has panicked. Category: MSGS; Reason: 251)
    [Unknown] at 0x8045ce28
    [Unknown] at 0x8046914e

    Could someone please assist?
    Last edited by KnowledgeSeeker; 2012-08-15 at 09:18.

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

    Re: How to close CMsvStore ?

    Quote Originally Posted by KnowledgeSeeker View Post
    Hi All am also experiencing the same problem.

    Debug error:
    Main [Thread id: 748] (Suspended : Error - Thread 0x2ec has panicked. Category: MSGS; Reason: 251)
    [Unknown] at 0x8045ce28
    [Unknown] at 0x8046914e

    Could someone please assist?
    You are likely using very different devices & SDKs than was used original query, since this thread has not been active for over 7 years now. In future you should not open old threads like this, but simply make a new thread for your problem.

    anyway, you might want to explain on which device you are experiencing the problem, also you should say what it is that you are trying to do with the code.

    and lastly, do include the code segment that is giving the error.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: How to close CMsvStore ?

    This panic is still related to the store, "EMsvStoreLeftOpenOnDestruction2=251" says MsvPanic.h.
    CMsvStore object is closed via deletion. So make sure that you delete it before you delete the related CMsvEntry object.

  6. #6
    Registered User
    Join Date
    Jul 2012
    Posts
    30

    Re: How to close CMsvStore ?

    Hi Gentlemen,

    Thank you for your responses;

    I'm still a bigginer in Symbian C++. and I'm trying to delete a specific sms in the sentBox msg folder. am not too sure of the syntax and thefore not too sure where I might be going wrong

    Here is what I've done so far, but I still get the same error:

    Code:
    void CSmsHandler::DeleteMessages() 
    {
    
    	HBufC* SMSContent = HBufC::NewLC(400);
    	//HBufC* SMSContent8 = HBufC::NewLC(400);
    
    	CMsvStore* sentboxStore;
    	
    	TMsvSelectionOrdering sort;
    	sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
     
    	CMsvEntry* sentboxContext=CMsvEntry::NewL(*iSession,KMsvSentEntryId,sort);
    	CleanupStack::PushL(sentboxContext);
     
    	CMsvEntrySelection* entries = sentboxContext->ChildrenL();
    	CleanupStack::PushL( entries );
    
    	TInt msgCount= entries->Count();
    	TInt i;
    	for (i=0; i <= msgCount; i++)
    	{
    		TMsvId entryID = entries->At(i);
    		iSmsMtm->SwitchCurrentEntryL(entryID);
     
    		CMsvEntry* entry= iSession->GetEntryL((*entries)[i]);
    		CleanupStack::PushL(entry);
    		  /* Skip loop if fail in obtains the message store */
    				TRAPD(r, sentboxStore = entry->ReadStoreL());
    		 
    				if(KErrNone != r)
    				{
    					CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    																							note->ExecuteLD(_L("Error Accessing inbox")); 	
    					CleanupStack::PopAndDestroy(entry);
    					continue;
    					
    					
    				}
    		 
    		
    				if (sentboxStore->HasBodyTextL())
    				{
    					CRichText& richText= iSmsMtm->Body();
    					sentboxStore->RestoreBodyTextL(richText);
    								const TInt length = richText.DocumentLength();
    					 
    					                   
    								SMSContent->Des().Copy(richText.Read(0,3)); 
    							
    								_LIT(KText1, "???");
    								TBufC16<3> buf11(KText1);
    								HBufC* buf1 = buf11.AllocLC();
    		
    								TInt res = buf1->Compare(SMSContent->Des());
    
    								
    								CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    								note->ExecuteLD(_L("Eveluating message: ")); 	
    							
    								CEikonEnv::Static()->AlertWin(*SMSContent); //Alert window..
    								
    								if (res == 0)
    								{
    									
    									CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    																		note->ExecuteLD(_L("DeletingMessage")); 
    																		
    																		//CleanupStack::PopAndDestroy(2,entry);
    																			
    																		//	CleanupStack::PopAndDestroy(4,SMSContent);
    																			
    																			//CleanupStack::PopAndDestroy(SMSContent);
    																			//CleanupStack::PopAndDestroy(buf1);
    																			//CleanupStack::PopAndDestroy(res);
    													
    																			//CleanupStack::PopAndDestroy(sentboxStore);	
    																		//delete sentboxStore;							
    								entry->DeleteL(entryID);
    								
    								CleanupStack::PopAndDestroy(sentboxStore);
    								CleanupStack::PopAndDestroy(entry);
    								
    								}
    								richText.Reset();
    					
    				}
    				else
    				{
    				// no text in SMS 
    					CAknInformationNote* note = new (ELeave)CAknInformationNote(ETrue);
    																							note->ExecuteLD(_L("NO Text")); 	
    				}
    	}
    	CleanupStack::PopAndDestroy(entries);
    	CleanupStack::PopAndDestroy(sentboxContext);
    }
    Last edited by wizard_hu_; 2012-08-16 at 13:24.

Posting Permissions

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