×
Namespaces

Variants
Actions

得到收件箱中未读短信的数量

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台:
Symbian

文章
User:Davey 2 在 02 Feb 2008 创建
最后由 hamishwillee 在 08 May 2013 编辑

适用版本:

 Series 60 2nd,Series 60 3rd

解决方案:

先通过KMsvGlobalInBoxIndexEntryId参数创建一个指向收件箱的CMsvEntry对象entry,通过entry->ChildrenL()函数可以得到指向收件箱中所有信息Id的CMsvEntrySelection对象,然后可以通过TMsvEntry::Unread()函数判断是否为未读短信,并计数,最后返回的unreadCoun包含未读短信的数量。以下为相关代码片段

 CMsvEntry* entry = CMsvEntry::NewL(*iMsvSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
 CleanupStack::PushL(entry);	
 CMsvEntrySelection* entries = entry->ChildrenL(); 
 CleanupStack::PushL(entries);
 TInt unreadCount;
 for(TInt i=0;i<entries->Count();i++) 
    {		
     entry->SetEntryL(entries->At(i));
     TMsvEntry msvEntry(entry->Entry());
     if( msvEntry.Unread())
        unreadCount++;
    }
 CleanupStack::PopAndDestroy(2);

best regards

davey_2

This page was last modified on 8 May 2013, at 03:02.
175 page views in the last 30 days.
×