hi 2 all
i want to move incoming sms in inbox to my folder.for that i have used this code but it only moves the last sms in inbox list......i wnat to move incoming sms.....
case EMsvEntriesCreated:
{
TMsvId* entryId = static_cast<TMsvId*>(aArg2); // entry id from the session event
if (*entryId == KMsvGlobalInBoxIndexEntryId) // new entry has been created in Inbox folder
{
TMsvSelectionOrdering sort;
sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, sort);
CleanupStack::PushL(parentEntry);
CMsvEntrySelection* entries = parentEntry->ChildrenL();
CleanupStack::PushL(entries);
parentEntry->MoveL( entries->At(i),KMsvMyFoldersEntryIdValue);
CleanupStack::PopAndDestroy( parentEntry );
CleanupStack::PopAndDestroy( entries );
}
break;
}
but it is moving only last sms from inbox.then for moving the incoming sms i made the changes in HandlesessionEventL() function.the new code i used is.....
void CSmsHandler::HandleSessionEventL( TMsvSessionEvent aEvent,
TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/)
{
switch ( aEvent )
{
case EMsvEntriesCreated:
{
TMsvId* entryId = static_cast<TMsvId*>(aArg2); // entry id from the session event
if (*entryId == KMsvGlobalInBoxIndexEntryId) // new entry has been created in Inbox folder
{
CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
CleanupStack::PushL(entries);
TMsvId iNewMsgId = entries->At(0);
CleanupStack::PopAndDestroy( entries );
}
break;
}
case EMsvEntriesMoved: {
TMsvId* entryId = static_cast<TMsvId*>(aArg2); // entry id from the session event
if (*entryId == KMsvGlobalInBoxIndexEntryId) // new entry has been created in Inbox folder
{
TMsvSelectionOrdering sort;
sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, sort);
CleanupStack::PushL(parentEntry);
CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1);
CleanupStack::PushL(entries);
for(TInt i = 0; i < entries->Count(); i++)
{
parentEntry->MoveL( entries->At(0), KMsvMyFoldersEntryIdValue);
}
CleanupStack::PopAndDestroy( parentEntry );
CleanupStack::PopAndDestroy( entries );
}
break;
}
i want to know why it is not moving any sms now?......i mean what change i should do for moving incoming sms.......
any help on this will be highly appreciated.
awaiting for your valuable reply.
regards
bharat




