Unable to delete SMS from inbox
| Mon, 2006-03-06 07:41 | |
|
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 |
|






Forum posts: 5
I cached entry id of the sms when it was received. Waited until HandleSessionEventL() terminates and performed deletion afterwards.
Forum posts: 141
if u want to delete any message from inbox or any folder u need to delete it from session.
Forum posts: 76
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