
SaveSetting and DeleteSetting calls
Quote:
>Has anyone managed to get the SaveSetting and
>DeleteSetting routines to work in Visual Basic
>4. After trying and failing inside my
>application I took the example given in the
>help file (listed below) and inserted it into
>a clean project - but still no success. Has
>anyone a solution ?
Are you getting an error message or what?
Quote:
>' Place some settings in the registry.
>SaveSetting(appname := "MyApp", section := "Startup", key := "Top", setting := 75)
I rather doubt this one would work, since it doesn't use anything like VB syntax
Quote:
>SaveSetting("MyApp","Startup", "Left", 50)
This one, however, sure looks like it should work, huh? Unfortunately, in VB,
if a call doesn't return a value, it's not a function - it's a procedure. In
VB, you call functions with the syntax
BB=MyFunc(a,b,c,d)
you call procedures with the syntax
MySub a, b, c
(note the lack of ()s).
This is usually what trips me up when I use SaveSetting. Remove the ()s from
the line. With them, VB thinks ("MyApp","Startup","Left",50) is the first
argument, and that you have chosen not to provide subsequent arguments.
Quote:
>' Remove section and all its settings from
>registry.
>DeleteSetting("MyApp", "Startup")
See notes about second SaveSetting line...
I have been able to get these to work fine for me in both 16-bit and 32-bit. In
the 32-Bit, the settings are stored in
HKEY_CURRENT_USER\Software\VB and VBA Program Settings\AppName\KeyName
You may not be looking in the right place...
Eric Rossing
Intec Company, Inc.
http://www.msen.com/~rossing