Namespaces
Variants
Actions

Sending an File Attachment using CSendUI

Jump to: navigation, search
Article Metadata

Article
Created: bharatuppal (13 Jul 2007)
Last edited: hamishwillee (03 Feb 2012)


The Following code shows the usage of Sending a file as an attachment via the list of all the connectivity services supported the devices. While using this code you will get the list of Connection Services you can use to send the attachement for example Bluetooth, Email, IRDA etc.

Headers:

#include <e32base.h>  // TUid
#include <senduiconsts.h>
#include <senduiconsts.h>
#include <tsendingcapabilities.h>
#include <cmessagedata.h>
#include <sendui.h>

Link against:

LIBRARY sendui.lib

Required capabilities:

CAPABILITY LocalServices NetworkServices ReadDeviceData WriteDeviceData ReadUserData WriteUserData

Define in your class header:

CMessageData* iMessageData;
CSendUi* iSendUi;

Initialize these fields in ConstructL:

iSendUi = CSendUi::NewL();
iMessageData = CMessageData::NewL();

Main method for sending:

void CMyClass::CreateAndSendAttachmentL(const TDesC& aFileName)
{
TUid serviceUid = iSendUi->ShowSendQueryL();
if(serviceUid.iUid != 0)
{
TSendingCapabilities capa;
iSendUi->ServiceCapabilitiesL(serviceUid, capa);
iMessageData->AppendAttachmentL(aFileName);
iSendUi->CreateAndSendMessageL(serviceUid, iMessageData);
}
}


Delete data in destructor:

delete iSendUi;
delete iMessageData;


You can achieve the above functionality using RSendAsMessage

This page was last modified on 3 February 2012, at 05:20.
68 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved