Read-only archive of the All About Symbian forum (2001–2013) · About this archive

How to launch an exe from another exe

1 replies · 3,903 views · Started 19 July 2004

Hi Friends,

I want to launch an exe from another exe.
Its just a console program.
The code compiles fine.But i am just not getting the result!!!

Somebody help.In the target HelloWorld just doesn't get launched !!!
I have 2 code snippets for RProcess method.
In the target I am not getting output for Helloworld( I have used RTest and RDebug for printing inside Helloworld)
------------------------------------------------------------------------
RProcess p;
TName command;
TFileName filename(RProcess().FileName());
TInt pos=filename.LocateReverse(TChar('\\'😉);
filename.SetLength(pos+1);
filename+=_L("HelloWorld.exe"😉;
p.Create(filename, command);
--------------------------------------------------------------------------
RProcess p;
_LIT(KMyAppName,"D:\\HelloWorld.exe"😉;
TBufC16<100> value(KMyAppName);
TUid huz;
huz.iUid=0x00000001; //huz.iUid is the UID of the HelloWorld.exe
TInt error = p.Create( KMyAppName, TPtr( NULL, 0 ), TUidType( KNullUid, KNullUid,huz) );
---------------------------------------------------------------------------
ITS VERY MUCH URGENT.PLEASE.........!!!

dhans wrote:Hi Friends,

I want to launch an exe from another exe.
Its just a console program.
The code compiles fine.But i am just not getting the result!!!

Somebody help.In the target HelloWorld just doesn't get launched !!!
I have 2 code snippets for RProcess method.
In the target I am not getting output for Helloworld( I have used RTest and RDebug for printing inside Helloworld)
------------------------------------------------------------------------
RProcess p;
TName command;
TFileName filename(RProcess().FileName());
TInt pos=filename.LocateReverse(TChar('\\'😉);
filename.SetLength(pos+1);
filename+=_L("HelloWorld.exe"😉;
p.Create(filename, command);
--------------------------------------------------------------------------
RProcess p;
_LIT(KMyAppName,"D:\\HelloWorld.exe"😉;
TBufC16<100> value(KMyAppName);
TUid huz;
huz.iUid=0x00000001; //huz.iUid is the UID of the HelloWorld.exe
TInt error = p.Create( KMyAppName, TPtr( NULL, 0 ), TUidType( KNullUid, KNullUid,huz) );

you should add p.Resume();

---------------------------------------------------------------------------
ITS VERY MUCH URGENT.PLEASE.........!!!