Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb6 app settings/params 1

Status
Not open for further replies.

whiteadi

Programmer
Apr 8, 2003
11
NL
Hi,

I have a old vb6 application I maintain,

that has the settings in a separate xml file.

But now I have to move those "inside" (to remove the xml, don't ask why :) ).

What would be best place/"paradigm" for such

settings to be handled in vb6 ?

Like database connections, general parameters...

Also to be easy to change it, u know what I mean.

I just searched on the web but until now could not find it.

Of course it is easy to hard code the ones for the moment

but maybe is a better way.

Regards,
a

 
Be aware that those read and create per-user registry entries. Global settings can't be stored that way as far as I know. You'd have to use the registry APIs or another solution, and then you'll run into possible security problems writing to most of HKLM anyway.

Use of the registry for application settings was deprecated beginning with Windows Vista. Per-computer and per-user INI or XML files are now the preferred way to persist application settings. There are special folder locations for such configuration files, do not put them in App.Path.
 
>Use of the registry for application settings was deprecated beginning with Windows Vista

If only someone had told Microsoft - who still use, for example, HKCU\Software for Office 2010, Visual Studio 2010 ...
 
yeah I cannot use the registry because the application is a desktop client for almost 1000 users each with it's right and I know around 500 do not have admin rights.

I cannot let it be in the xml because I tried a few time to remake the setup but there are just 2 many dependencies and I could not get it right (3d party dll's no longer supported...).

And also to distribute the updates would require changes in network settings/tunneling to let the xml flow but also am not sure if then I can overwrite the old xml on users desktops.

So as ugly as it is I think I will put it in the code somewhere, anyway I am the only one that changes those and only with a new release, if necessary.
 
The per user settings in the registry, as used by GetSetting and SaveSetting, shouldn't need admin rights
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top