Namespaces
Variants
Actions
Revision as of 13:56, 25 July 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to run the file with the default application

Jump to: navigation, search
Article Metadata

Article
Created: kavitaobhan (20 Nov 2007)
Last edited: hamishwillee (25 Jul 2012)

Headers

#include <apacmdln.h>  
#include <apgcli.h>
#include <apgtask.h>
#include <w32std.h>


Running a File with the default application

// Starts the default application for the passed file and runs the file in it.
/*
*@param aFileLocation :- File to be Launched by corresponding default application.
*/

 
 
void MySystemClass::LaunchDefaultApp( const TDesC& aFileLocation )
{
RApaLsSession applicationSession;
TUid Uid;
TDataType currentdataType;
RFs file;
RWsSession windowSession;
TThreadId currentthreadId;
 
file.Connect();
applicationSession.Connect();
applicationSession.GetAllApps();
applicationSession.AppForDocument(aFileLocation ,Uid,currentdataType);
windowSession.Connect();
 
TApaTaskList apataskList(windowSession);
TApaTask apatask = apataskList.FindApp( Uid );
 
applicationSession.StartDocument(aFileLocation ,Uid,currentthreadId);
applicationSession.Close();
file.Close();
windowSession.Close();
 
 
}

Related Links

Launching default application based on MIME type

93 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