本文整理汇总了C++中CMsvEntry::Session方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::Session方法的具体用法?C++ CMsvEntry::Session怎么用?C++ CMsvEntry::Session使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::Session方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StoreMsgL
// -----------------------------------------------------------------------------
// CWPMessage::StoreMsgL
// -----------------------------------------------------------------------------
//
void CWPMessage::StoreMsgL()
{
FLOG( _L( "CWPMessage::StoreMsgL" ) );
// create an invisible blank entry
TMsvEntry entry;
PrepareEntryLC( entry ); // details on cleanup stack
entry.iBioType = iBioUID.iUid;
entry.iMtm = KUidBIOMessageTypeMtm;
// Look up and set the description
FLOG( _L( "CWPMessage::StoreMsgL 1" ) );
TInt index;
CBIODatabase* bioDB = CBIODatabase::NewLC( iSession->FileSession() );
FLOG( _L( "CWPMessage::StoreMsgL 2" ) );
TRAPD( err, bioDB->GetBioIndexWithMsgIDL( iBioUID, index ) );
if (err ==KErrNone)
{
FLOG( _L( "CWPMessage::StoreMsgL 3" ) );
HBufC* description = bioDB->BifReader(index).Description().AllocL();
FLOG( _L( "CWPMessage::StoreMsgL 4" ) );
entry.iDescription.Set(*description);
FLOG( _L( "CWPMessage::StoreMsgL 5" ) );
CleanupStack::PopAndDestroy(); // bioDB
CleanupStack::PushL( description );
}
else
{
FTRACE(RDebug::Print(_L(" CWPMessage::StoreMsgL err (%d)"), err));
CleanupStack::PopAndDestroy(); // bioDB
}
FLOG( _L( "CWPMessage::StoreMsgL 6" ) );
// Store entry in inbox
CMsvEntry* msvEntry = iSession->GetEntryL( KMsvGlobalInBoxIndexEntryId );
FLOG( _L( "CWPMessage::StoreMsgL 7" ) );
CleanupStack::PushL(msvEntry);
msvEntry->CreateL(entry);
msvEntry->Session().CleanupEntryPushL(entry.Id());
msvEntry->SetEntryL(entry.Id());
FLOG( _L( "CWPMessage::StoreMsgL 8" ) );
// Save the message
CMsvStore* store = msvEntry->EditStoreL();
CleanupStack::PushL(store);
FLOG( _L( "CWPMessage::StoreMsgL 9" ) );
iMessage->StoreL( *store );
store->CommitL();
// Complete processing the message
PostprocessEntryL( *msvEntry, entry );
CleanupStack::PopAndDestroy(); //store
msvEntry->Session().CleanupEntryPop(); //entry
CleanupStack::PopAndDestroy(3); //description, details, msvEntry
FLOG( _L( "CWPMessage::StoreMsgL Done" ) );
}