Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User puh_sk8@hotmail.com's Avatar
    Join Date
    Aug 2006
    Location
    London
    Posts
    22
    Hi

    Hope someone can help me with this...

    I have 2 apps, the first is a simple HelloWorld GUI app. this works fine and runs off the icon no problem.

    My second app is another GUI app but with different name and UID. When the user presses the icon for the second app i want it to open up, start the first app and then close.

    here is the code i am using...
    Code:
      RProcess server;
      server.Create(KServerName, KNullDesC);
    
      CApaCommandLine* commandLine = CApaCommandLine::NewL();
      commandLine->SetExecutableNameL(KExecutableName);
      commandLine->SetProcessEnvironmentL(server);
    
      RApaLsSession ApaSession;
      ApaSession.Connect();
      ApaSession.StartApp(*commandLine);
      ApaSession.Close();
    
      delete commandLine;
    which i got from Symbian Example

    I get no errors in the compiling and i can install on the device, but when i click the icon the screen flashes as if the app is starting but then returns to the main menu without starting the other app.

    the executable i'm trying to launch is c:\sys\bin\HelloWorld.exe and it has a UID from the unprotected range (0xA000161C)

    What values should KExecutableName, KServerName and KNullDesC be set to?
    Should these be filenames/UID/something else?

    I'm using Carbide.C++ Express for development.

    I'm totally new to c++ so i'm really greatful for all the help i can get.

    Paul

  2. #2
    Registered User awm129's Avatar
    Join Date
    Dec 2006
    Posts
    2
    KExecutableName should be the name of the app you are trying to launch. Namely, c:\sys\bin\HelloWorld.exe.

    KNullDesC passes a command to the initial thread of the process you are trying to create. You can leave this blank unless you know you need something here.

    Try running your app with TaskSpy running the background. TaskSpy will report Panics in case you're doing something wrong.

  3. #3
    Registered User puh_sk8@hotmail.com's Avatar
    Join Date
    Aug 2006
    Location
    London
    Posts
    22
    At the moment i have KExecutableName set like...

    Code:
    _LIT(KExecutableName, "c:\\sys\\bin\\HelloWorld.exe");
    I have also tried...
    c:\\sys\\bin\\HelloWorld
    c:\sys\bin\HelloWorld
    c:\sys\bin\HelloWorld.exe
    c:\\sys\\bin\\0xA000161C
    c:\sys\bin\0xA000161C
    HelloWorld.exe
    HelloWorld
    and
    0xA000161C

    none of these start my other app.

    Which is the correct path/format for the executable name?

    Does the KServerName have to be a specific value? what should i set this to?

  4. #4
    Regular Contributor Tina_Tibrewal's Avatar
    Join Date
    Sep 2006
    Posts
    280
    Try using this code:
    Code:
    CApaCommandLine* comndLine = CApaCommandLine::NewLC();
    comndLine ->SetExecutableNameL( aExe );// aExe is exe name in buffer
    comndLine ->SetCommandL( EApaCommandRun );
    RApaLsSession apaSession;
    apaSession.Connect();
    apaSession.StartApp( *comndLine );
    apaSession.Close();
    CleanupStack::PopAndDestroy( comndLine );

  5. #5
    Registered User puh_sk8@hotmail.com's Avatar
    Join Date
    Aug 2006
    Location
    London
    Posts
    22
    Thanks Tina, that worked great...

    Where the SetExecutableNameL appears, is it possible to set a document name to open in that app?

    eg. if i was calling a picture viewer, could i tell it to open with a specified jpg?

    something like...
    Code:
    _LIT(KJpegName, "C:\\data\\others\\image.jpg");
    comndLine->SetDocumentL(KJpegName);
    I think i have seen this somewhere before but i don't know where?

Similar Threads

  1. HTTP headers for S60 3rd Ed. Browser
    By Nokia Ron in forum Mobile Web Site Development
    Replies: 16
    Last Post: 2009-09-22, 14:28
  2. SyncML API and S60 3rd edition?
    By harri_salminen in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2008-03-20, 14:50
  3. Carbide c++ and S60 3rd Edition Feature Pack 1 Working
    By jimgilmour1 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-10-18, 20:39
  4. 3rd edition Launching, EXE on App Start and Uninstall
    By kiranpuranik in forum Symbian C++
    Replies: 5
    Last Post: 2006-06-30, 12:06
  5. S60 2nd OR 3rd edition for new software development
    By patil_ruturaj in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-06-30, 09:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
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