SMS调用系统的浏览视图

来源:互联网 发布:怎样在淘宝网买东西 编辑:程序博客网 时间:2024/04/26 08:42

知道一条信息的TMsvId,想打开信息浏览视图,主要用如下代码实现:

 

系统的SMS ViewID:(TVwsViewId(KPhoneSMSUid, KPhoneSMSViewUid))

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 );}
原创粉丝点击