×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: INI Files

  1. #1
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI Files

    Hi All,

    I'm trying to read from an INI file for my Application, which has certain settings saved.

    Now I'm trying to create the CDictionaryStore in APPUi ConstructL withe following statement. But I get error such as

    CDictionaryStore *iniFile = Application()->OpenIniFileLC(iEikonEnv->FsSession());


    illegal use of incomplete union/struct.


    Please let me knwo how to resolve this problem. Also in case you do have some example snippet of code to achieve the same please let me know. It will be a real help


    Thanx & Regards,

    Kamal Singhania

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    it's propably, because one of the header files you have included has this line:

    class CDictionaryStore;

    So the definition is sort of found, but it is incomplete. So check the class memebr that gives this error, and locate the header file for it, and include it to your files.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI Files

    yes you are right, I've been able to compile the code successfully.

    But the problem I'm now facing is that when I run it on the device it says Feature not Supported.

    Please let me know what could possibly be the reason for it. Also if you have some sample code snippets please share ot with me.


    it will be a great help.


    Thanx

    Kamal

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    hmmm, it it says not supported, could be that for some reason the phone doesn't want to support default ini files.

    Anyway, you could always take the application name from application class, and just replace the extension to be ini. And construct the dictionary store by your self.

    At least, then you shouldn't get any not-supported error messages.

    yucca

  5. #5
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI Files

    Yes that may be the case, do u have some sample code snippet for the same, or could u point me to somewhere I can find some.


    Kamal

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    you could do it something like this:

    TFileName Buffer;
    TParse parse;
    #ifdef __WINS__
    Buffer.Copy(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName());
    parse.Set(_L("c:"), &Buffer, NULL);
    #else
    parse.Set(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName(), NULL, NULL);
    #endif

    Buffer.Copy(parse.DriveAndPath());
    Buffer.Append(parse.Name());
    Buffer.Append(_L(".ini"));

    CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),Buffer, TUid::Uid(0x102013AD));


    yucca

  7. #7
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI File

    Thanx for the help,

    but what is this UID

    TUid::Uid(0x102013AD))

    is it the application UID

    Kamal

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    it's just a UID that I used with one app, basically where I copied the lines from. Anyway, I would suggest you to use your application UID for the purpose.

    yucca

  9. #9
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI Files

    I tried using the APPUId, but my applicaion crashed at the point.

    Kamal

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    what sort of error are you getting ?

    See this to get errors right: http://www.newlc.com/article.php3?id_article=150

    and this for the explanation : http://www.newlc.com/article.php3?id_article=117

    Also did you remember to make the folder in your emulators C: drive, before running the code ?

    yucca

  11. #11
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    A comment to the original post: OpenIniFileLC() is overridden to a non-functional version in CAknApplication. In CEikApplication (superclass of CAknApplication) it is functional. So you should get it working by explicitly calling CEikApplication::OpenIniFileLC().

    Lauri

  12. #12
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI files

    Hi

    Thanx for your reply, my app does not display any panic codes when it crashes.

    If u have any example working with that peice of code to use INI
    please send it to me.


    Thanx

    kamal singahnia

  13. #13
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI File

    I tried the code that was mentoned in the posts some time back by Yucca.

    But the app keeps crashing on the Device. On the emulator it gives no error. But the moment it is put on the device it crashes.

    Also I've installed the App on the Memory card, that is e:.

    Please let me know id there is any resolution to this.

    kamal

  14. #14
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    BTW, which phone are you testing it in ?

    So far I have only seen crashes that doesn't produce error notes on 6630 & 6760, so if you could test it on any other phone it could help.

    also, are you working on app or exe ?

    yucca

  15. #15
    Regular Contributor
    Join Date
    Dec 2004
    Location
    Mumbai
    Posts
    67

    INI Files

    Hi I'm using the 6600 to test. and am working on an App.

    If possible could u gimme ur code snippet for me try around.

    Regards,

    Kamal Singhania

Posting Permissions

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