当前位置: 代码迷 >> Symbian >> RestoreSettingsL()与HasStoreL()的有关问题(s60 3rd)
  详细解决方案

RestoreSettingsL()与HasStoreL()的有关问题(s60 3rd)

热度:6968   发布时间:2013-02-26 00:00:00.0
求助RestoreSettingsL()与HasStoreL()的问题(s60 3rd)
各位大侠你们好,我最近在写一个提取邮件相关内容的程序,遇到两个小问题,百思不得其解,找了好长时间资料,还是没有解决,所以想请各位帮我看一下(S60 3rd)

问题一:我在提取邮件内容的时候用了一个判断HasStoreL(),但总是返回False,跳过取内容的代码,不知道什么原因,主要代码如下:
TMsvId id( FindServiceL( KUidMsgTypePOP3 ) );
iRemoteEntries = UpdateEntriesL( id );
TMsvId entryId( (*iRemoteEntries)[aIndex] );
iEntry = iMsvSession->GetEntryL( entryId );
if (!iEntry->HasStoreL()) //always return false
{
//main code
}

问题二:在取用户名和密码的时候,用了一个RestoreSettingsL(),运行到这里就错误推出,Leave code:-46,主要代码如下:
CMsvEntry* entry=iMsvSession->GetEntryL(FindServiceL(KUidMsgTypePOP3));
CleanupStack::PushL(entry);
iNewMtm->SetCurrentEntryL(entry);
iNewMtm->RestoreSettingsL();
CImPop3Settings const& temp = iNewMtm->Settings();

希望各位高手能帮一下忙,在下感激不尽!!

------解决方案--------------------------------------------------------
第一个是iEntry 没有真正得到这个entry
第二个是因为没有访问权限