I am developing sms based application i try to delete sent items i got code from wiki http://wiki.forum.nokia.com/index.php/SMS_Operations
i want to delete sent messages only send from my application? problem is when i compose a message from default Messaging app this code delete that mesasges also.
// 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 )
sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvSentEntryId, sort);
CMsvEntrySelection* entries = parentEntry->ChildrenL();
for(TInt i = 0; i < entries->Count(); i++)
if( parentEntry->ChildDataL(entries->At(i)).iMtmData3 != KUidMsgTypeSMS.iUid )
CleanupStack::PopAndDestroy( entries );
CleanupStack::PopAndDestroy( parentEntry );