Best way to set application settings on the device?

RB Smissaert

Well-Known Member
Licensed User
Longtime 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
 

RB Smissaert

Well-Known Member
Licensed User
Longtime 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.
 

Mr_Gee

Active Member
Licensed User
Longtime 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 ;-)
 

RB Smissaert

Well-Known Member
Licensed User
Longtime 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.
 

Mr_Gee

Active Member
Licensed User
Longtime User
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.

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)
 

RB Smissaert

Well-Known Member
Licensed User
Longtime 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
 

RB Smissaert

Well-Known Member
Licensed User
Longtime 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
 

RB Smissaert

Well-Known Member
Licensed User
Longtime 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
 

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:
Top