Best way to set application settings on the device?

Discussion in 'Questions (Windows Mobile)' started by RB Smissaert, Dec 8, 2008.

  1. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    What is the best way to have application settings (user editable, so they can't be compiled with the exe) on the device? Ideally I would like a simple .ini file, but I can't see functions like GetPrivateProfileString as in the Windows API.
    I suppose I could just read the .ini file with FileOpen and FileRead etc. but that gets a bit messy.

    RBS
     
  2. DaveW

    DaveW Active Member Licensed User

  3. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Thanks, will try maXim's INI file.

    RBS

    PS:
    Bedankt voor de tip. Barneveld is niet ver van Bennekom waar ik gewoond heb.
    Groeten vanuit Wolverhampton UK.
     
  4. Mr_Gee

    Mr_Gee Active Member Licensed User

    I'm not familiar with the "GetPrivateProfileString" but I recently discovered the registery for saving usersettings..

    I used to use a .txt file, usually renamed to .sav
    And indeed use FileOpen, works pretty good.


    Good luck

    PS. en Hilversum ligt weer vlak bij Barneveld, wat is Nederland toch klein ;-)
     
  5. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    > discovered the registery for saving usersettings

    Yes, I noticed that option, but I was thinking then you still need some kind of file to supply with your application to have the settings and then you might as well forget about the registry.

    RBS

    ps: interesting to hear some Dutch here, been living in UK since 1987.
     
  6. Mr_Gee

    Mr_Gee Active Member Licensed User

    Thought about that too, I have the reg. check if the entry is there,
    if it isn't it must be the first time the Application is running so I populate the values with default information.
    Another option is to populate the registry when you install your application,
    using Erel's Setupbuilder you will be able to modify the registry (you will have to tweak it a bit though)
     
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Thanks for the tip. I think I will go Maxim's dll as that means the same syntax
    and the same file on the device and on the PC where I code in VB(a).

    RBS
     
  9. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Looks I can't use Maxim's .ini dll as I get the following error on the device:

    An error occured on Sub ....
    File or assembly name Microsoft.VisualBasic version 7.0.5000.0
    culture = neutral
    Publickey Token = B03F5F7F 11D50A3A or one of it's depencies was not found.

    I have copied the file: db2000 INI file manager (device).dll (version 1.0.1.0)
    to the device and I can run it all fine on the desktop.

    Any suggestion what I might be doing wrong here?
    This is on the latest Windows Mobile on a Samsung Omnia.

    RBS
     
  10. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    I forgot to say that the error occurs at the line:

    INI.New1(AppPath & "\PPC.ini")

    RBS
     
  11. Mr_Gee

    Mr_Gee Active Member Licensed User

    have you tried
    INI.New1("PPC.ini")?
     
  12. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    No, I thought it needed the full path.
    I have in fact solved this by using instead the larger file: db2000 functions library.dll. This is with the same B4PPC code, so with the full .ini path in the New1. As the larger dll has some useful date functions I think I will stick with that one.

    RBS
     
  13. RacingDog

    RacingDog Active Member Licensed User

    Did anybody solve the problem in those last two posts? Does that now work on devices?

    Ignore that, didn't see page 2, got distracted by a horse race.

    BTW, when you have your ini files, if they get big, then the freebie I found at http://vdobiasch.bplaced.net/VD/softe.html works perfectly well for managing ini files outside of your app, it works in English or German.
     
    Last edited: Jun 5, 2010
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice