Unable to delete SMS from inbox

Login to reply to this topic.
Mon, 2006-03-06 07:41
Joined: 2005-06-01
Forum posts: 76
Hi All,

I have tried a lot to delete the SMS from inbox. I have one exe which is looking for the incoming SMS. I get the SMS and after processing the text of the SMS I would like to delete it. But I am not able to delete it.

I am attaching the piece of code ..


void SMSHandler::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/)
{
switch(aEvent)
{
case EMsvServerReady:
{
if(iMsvEntry == NULL)
{
iMsvEntry = CMsvEntry::NewL(*iMsvSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
}
}
break;

case EMsvEntriesCreated:
{

if(*(static_cast<TMsvId*>(aArg2)) == KObservedFolderId)
{
CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*> (aArg1);
iNewMessageID = entries->At(0);
}
}
break;

case EMsvEntriesChanged:
{

if (*(static_cast<TMsvId*>(aArg2)) == KObservedFolderId)
{
CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
iNewMessageID = entries->At(0);
if(iNewMessageID == NULL)
break;
if (iNewMessageID == entries->At(0))
{

// It's the same message we received the EMsvEntriesCreated event for

// Set entry context to the new message

iMsvEntry->SetEntryL(iNewMessageID);

// Open the store, read-only

CMsvStore* store = iMsvEntry->ReadStoreL();
CleanupStack::PushL(store);

// Get body text and send it to the container

if (store->HasBodyTextL())
{
// process message body
// delete if we have handled it.

// the SMS deletion ..

iMsvEntry->DeleteL(iNewMessageID);
//store->DeleteL();
}
}
}

Can anyone plz figure out whats wrong with my code ? why the message is not getting deleted?

And I would like to know how can I stop the incoming SMS dialog and sound?

thanks a lot in advance.

..
KiraN Puranik

Mon, 2006-03-06 08:39
Joined: 2005-12-19
Forum posts: 5
Re: Unable to delete SMS from inbox
I got a similar problem. But my app was crashing in addition to not deleting Smiley.
I cached entry id of the sms when it was received. Waited until HandleSessionEventL() terminates and performed deletion afterwards.
Mon, 2006-03-06 10:26
Joined: 2005-09-16
Forum posts: 141
Re: Unable to delete SMS from inbox
Hi,

if u want to delete any message from inbox or any folder u need to delete it from session.

Tue, 2006-03-07 06:44
Joined: 2005-06-01
Forum posts: 76
Re: Unable to delete SMS from inbox
Hi eswar,

I managed to delete it using MsvSession. But still the dialog and SMS tone pops up. I want to stop everything on incoimg SMS.

thanks a lot.

..
KiraN Puranik
  • Login to reply to this topic.