本文整理汇总了C++中CMsvAttachment::EntryAttachmentId方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvAttachment::EntryAttachmentId方法的具体用法?C++ CMsvAttachment::EntryAttachmentId怎么用?C++ CMsvAttachment::EntryAttachmentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvAttachment
的用法示例。
在下文中一共展示了CMsvAttachment::EntryAttachmentId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunTestL
void CMtfTestActionSmtpRemoveEntryAttachmentById::RunTestL()
{
CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
TMsvAttachmentId attachId = ObtainValueParameterL<TMsvAttachmentId>(TestCase(),ActionParameters().Parameter(2));
CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
CleanupStack::PushL(entry);
CImEmailMessage* emailMsg = CImEmailMessage::NewL(*entry);
CleanupStack::PushL(emailMsg);
MMsvAttachmentManager& manager = emailMsg->AttachmentManager();
CMsvAttachment* attachInfo = manager.GetAttachmentInfoL(attachId);
CleanupStack::PushL(attachInfo);
// First ensure that the attachment is a file attachment
if( attachInfo->Type() != CMsvAttachment::EMsvMessageEntry )
{
User::Leave(KErrGeneral);
}
// Get the linked file
TMsvId msgId = attachInfo->EntryAttachmentId();
CleanupStack::PopAndDestroy(attachInfo);
// Remove the attachment
CMtfAsyncWaiter* waiter = CMtfAsyncWaiter::NewL();
CleanupStack::PushL(waiter);
manager.RemoveAttachmentL(attachId, waiter->iStatus);
waiter->StartAndWait();
User::LeaveIfError(waiter->Result());
CleanupStack::PopAndDestroy(waiter);
CleanupStack::PopAndDestroy(2, entry); // email msg, entry
// Ensure that the message entry still exists
CMsvEntry* checkEntry = paramSession->GetEntryL(msgId);
delete checkEntry;
checkEntry = NULL;
}