attachments to messages
The messaging framework allows you to add attachments to messages.
A message attachment,
once it has been created, must be added to its message in a separate procedure
explained in this document.
Create an active object implementation. All the
that modify attachments for an entry are asynchronous, so a request must be
called with an active object implementation.
//* Active object request function to add an attachment.
aEntry - entry to make attachment for
aAttachPath - path of file to attach
aSize - size of attachment in bytes
void CFoo::AttachFileL(CMsvEntry& aEntry, const TFileName& aAttachPath, TInt aSize)
// Wait for request to complete
Get the details
of the message to which you want to add an attachment using
This function returns
in writable mode.
// Get store
CMsvStore* store = aEntry.EditStoreL();
manager for the message entry, using
// Get attachment manager from the entry's store
MMsvAttachmentManager& attManager = store->AttachmentManagerL();
Create a new attachment attributes object using the
// Create a new attachment attributes object
CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
Set the attachments name and size attributes using the functions of
// Set the attachment name and size attributes
Add the attachment using any of the following functions:
Note: For OBEX MTM, to add headers to an attachment, use the
Headers can be retrieved using the
For copied attachments, use the
For linked attachments, use the
// Ownership of attachment will transfer to attachManager
// Add the attachment
attManager.AddAttachmentL(aAttachPath, attachment, status);
Commit the store.
You now have an
attachment added to its message.
You can now retrieve
and modify the message attachment.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License