From: Kevin Provance on

"mscir" <mscir(a)yahoo.com> wrote in message
news:i3nb6j$voe$1(a)news.eternal-september.org...
:
: I'm reluctant to use the registry because I don't know anything about
: how the various versions of Vista or W7 will handle permissions. Do you
: know if it is the case that a VB6 program running under those OS's as an
: Admin, or as a user with limited rights, in any mode available, will
: always be able to write to the registry with no problems? I want the
: simplest solutions that will require the least maintenance and run on
: any version of XP or later, so I'm using CSIDL_APPDATA. This program
: will be run by only one user on any given machine, and speed is not an
: issue (I think registry reading is probably a lot faster than INI
: reading) so I just want to keep this as robust an approach as possible.
:

Here is a guideline to work by:

Always assume your app runs without Admin priv (most don't quire it anyway)
and remember your rules as such. In regard to the registry, you can READ
anywhere you want. Writing is only appropriate to HKCU. Everything else is
and should be off limits.

From: Nobody on
"mscir" <mscir(a)yahoo.com> wrote in message
news:i3nb6j$voe$1(a)news.eternal-september.org...
> I'm reluctant to use the registry because I don't know anything about how
> the various versions of Vista or W7 will handle permissions. Do you know
> if it is the case that a VB6 program running under those OS's as an Admin,
> or as a user with limited rights, in any mode available, will always be
> able to write to the registry with no problems? I want the simplest
> solutions that will require the least maintenance and run on any version
> of XP or later, so I'm using CSIDL_APPDATA. This program will be run by
> only one user on any given machine, and speed is not an issue (I think
> registry reading is probably a lot faster than INI reading) so I just want
> to keep this as robust an approach as possible.

Like Kevin said, only HKCU is writable in the registry, and each user has
his own copy. HKLM is read only. GetSetting/SaveSetting use HKCU, so they
are okay to use. If you have a lot of settings, more than 2 KB, then perhaps
an INI file is more appropriate. More than 64KB, and you need something
other than INI files. One issue that you might have with
GetSetting/SaveSetting is that they always save and read strings. If someone
created a DWORD or binary value, you get Error 5, Invalid procedure call or
argument. This happens if a user added a value by using RegEdit for example.


From: Mike S on
On 8/8/2010 5:05 PM, Nobody wrote:
> "mscir"<mscir(a)yahoo.com> wrote in message
> news:i3nb6j$voe$1(a)news.eternal-september.org...
>> I'm reluctant to use the registry because I don't know anything about how
>> the various versions of Vista or W7 will handle permissions. Do you know
>> if it is the case that a VB6 program running under those OS's as an Admin,
>> or as a user with limited rights, in any mode available, will always be
>> able to write to the registry with no problems? I want the simplest
>> solutions that will require the least maintenance and run on any version
>> of XP or later, so I'm using CSIDL_APPDATA. This program will be run by
>> only one user on any given machine, and speed is not an issue (I think
>> registry reading is probably a lot faster than INI reading) so I just want
>> to keep this as robust an approach as possible.
>
> Like Kevin said, only HKCU is writable in the registry, and each user has
> his own copy. HKLM is read only. GetSetting/SaveSetting use HKCU, so they
> are okay to use. If you have a lot of settings, more than 2 KB, then perhaps
> an INI file is more appropriate. More than 64KB, and you need something
> other than INI files. One issue that you might have with
> GetSetting/SaveSetting is that they always save and read strings. If someone
> created a DWORD or binary value, you get Error 5, Invalid procedure call or
> argument. This happens if a user added a value by using RegEdit for example.


Thanks Kevin, and thank you Nobody for the detailed explanation.

First  |  Prev  | 
Pages: 1 2 3
Prev: RegClean Revisited
Next: Make a Backup