您的位置:首页 > 其它

知道一条信息的TMsvId,如何打开信息浏览视图

2008-07-31 08:47 381 查看
知道一条信息的TMsvId,想打开信息浏览视图,主要用如下代码实现:
void CMtmEngine::OpenMessage(TMsvId aId)
{

TMsvEntry msgEntry; // class that represents the entry (a local cache)
TMsvId ownerServiceId;

if( iSession->GetEntry( aId,ownerServiceId, msgEntry )
!= KErrNone )
return;
CClientMtmRegistry *cltReg = CClientMtmRegistry::NewL( *iSession );
CleanupStack::PushL( cltReg );

CBaseMtm *mtm = cltReg->NewMtmL( msgEntry.iMtm );
CleanupStack::PushL( mtm );

CMtmUiRegistry *reg = CMtmUiRegistry::NewL( *iSession );
CleanupStack::PushL( reg );

CBaseMtmUi *ui = reg->NewMtmUiL( *mtm );
CleanupStack::PushL( ui );

mtm->SwitchCurrentEntryL( msgEntry.Id() );
//Editor are embedded.
ui->SetPreferences( EMtmUiFlagEditorPreferEmbedded );

CMsvOperationActiveSchedulerWait *waiter = CMsvOperationActiveSchedulerWait::NewLC();

CMsvOperation* op = ui->ViewL( waiter->iStatus );

waiter->Start();

delete op;
CleanupStack::PopAndDestroy( 5, cltReg );

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: