Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    8

    broken path when installing app in memory

    i made an app for the series 60 phones. problem is when i install the app in memory (specifically the 3650's memory card), i get the
    'system error' when i run it, because in my code i access the mbm and other files like this:

    _LIT(KFile, "\\system\\apps\\app\\app.mbm");

    (previsouly it had a "c:" at the start of the path. but i removed it)

    now, my question is

    what changes will i make to the code and .pkg file to ensure that my app will run no matter where it's installed

    thanks in advance!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,184
    hi

    You could basically copy the file into your application folder, which ever drive it'll be installed in.

    Then you could use following code to find the file in side your code:


    _LIT(KFile, "app.mbm");
    TBuf<255> Buffer;
    TParse parse;
    parse.Set(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName(), NULL, NULL);

    Buffer.Copy(parse.DriveAndPath());
    Buffer.Append(KFile);


    yucca

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    8
    actually i already found the solution prior to your posting, but still i used your code

    it's just that i used the wrong set of keywords in searching thru the archives before posting/asking.

    thanks again!

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    just one small note to yucca:

    Isn't better to use TFileName instead of TBuf<255> for storing file names? I know that it is basically the same, but for easier maintanence of code...... What if Nokia decides in few years that the best directory for your app is "c:/documents and settings/system and other related files/nokia and other friendly companies/your name and names of your relatives/ other 200 characters /your app/"..:-))
    And makes TFileName to handle 1024 characters in file names. Code using TFileName will work, but some lousy TBuf with only 255 chars will break down...:-))

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,184
    sure sopta, you're right.

    yucca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×