Settings in VB6 App Using Registry |
Author: |
Message: |
Salem
Senior Member
Posts: 769 Reputation: 16
37 / /
Joined: May 2004
|
O.P. RE: RE: Settings in VB6 App Using Registry
quote: Originally posted by Dempsey
code: SaveSetting ("MyAppName", "MySettingName", "MySettingValue")
GetSetting ("MyAppName", "MySettingName")
Thanks just two more Q's
[list=1]
[*]If i say use GetSetting to retrive a setting in the registry, how would i put the value retrieved into a variable? eg, into a variable called SettingValue
[*]If i would like an installer to create default values for a MySettingName, where should this be created?
[/list]
Thanks
Was i Helpful?[/url]
|
|
09-07-2005 07:43 PM |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
Joined: Oct 2003
|
RE: Settings in VB6 App Using Registry
Dim value As Variant
value = GetSetting("MyAppName", "MySettingName")
And please don't double-post - edit.
|
|
09-07-2005 07:56 PM |
|
|
Salem
Senior Member
Posts: 769 Reputation: 16
37 / /
Joined: May 2004
|
O.P. RE: RE: Settings in VB6 App Using Registry
quote: Originally posted by raceprouk
Dim value As Variant
value = GetSetting("MyAppName", "MySettingName")
And please don't double-post - edit.
Thanks i thought i would be somethhing like that.
Sorry about the double post.
Do you know an answer to question 2?
quote: 2. If i would like an installer to create default values for a MySettingName, where should this be created?
Edit: Double post deleted
This post was edited on 09-07-2005 at 08:01 PM by Salem.
Was i Helpful?[/url]
|
|
09-07-2005 07:58 PM |
|
|
RaceProUK
Elite Member
Posts: 6073 Reputation: 57
39 / /
Joined: Oct 2003
|
RE: Settings in VB6 App Using Registry
Just beware of using Variants - the lack of type checking can be the source of errors later.
|
|
09-07-2005 08:00 PM |
|
|
Dempsey
Scripting Contest Winner
http://AdamDempsey.net
Posts: 2395 Reputation: 53
38 / /
Joined: Jul 2003
|
RE: Settings in VB6 App Using Registry
quote: Originally posted by RileyM
Thanks just two more Q's
[list=1]
[*]If i say use GetSetting to retrive a setting in the registry, how would i put the value retrieved into a variable? eg, into a variable called SettingValue
[*]If i would like an installer to create default values for a MySettingName, where should this be created?
[/list]
Thanks
1. You would use something like.....
code: SaveSetting "MyAppName","Settings","SettingName","SettingValue")
2. I assume you mean if you're using an insatller such as NSIS or Inno Setup, in which case the path is:
quote: HKEY_CURRENT_USER\Software\VB and VBA Program Settings\MyAppName\Settings
|
|
09-07-2005 08:02 PM |
|
|
Salem
Senior Member
Posts: 769 Reputation: 16
37 / /
Joined: May 2004
|
O.P. RE: RE: Settings in VB6 App Using Registry
quote: Originally posted by Dempsey
quote: Originally posted by RileyM
Thanks just two more Q's
[list=1]
[*]If i say use GetSetting to retrive a setting in the registry, how would i put the value retrieved into a variable? eg, into a variable called SettingValue
[*]If i would like an installer to create default values for a MySettingName, where should this be created?
[/list]
Thanks
2. I assume you mean if you're using an insatller such as NSIS or Inno Setup, in which case the path is:
quote: HKEY_CURRENT_USER\Software\VB and VBA Program Settings\MyAppName\Settings
Yes this is what i meant, Thanks again
Was i Helpful?[/url]
|
|
09-07-2005 08:04 PM |
|
|
Millenium_edition
Veteran Member
Posts: 1787 Reputation: 57
Joined: Apr 2003
|
RE: Settings in VB6 App Using Registry
quote: Originally posted by raceprouk
Just beware of using Variants - the lack of type checking can be the source of errors later.
even if you don't use the variants, type checking in VB is incredibly limited...
|
|
09-07-2005 08:08 PM |
|
|
Salem
Senior Member
Posts: 769 Reputation: 16
37 / /
Joined: May 2004
|
O.P. RE: Settings in VB6 App Using Registry
quote: SaveSetting ("MyAppName", "MySettingName", "MySettingValue")
GetSetting ("MyAppName", "MySettingName")
When typing the SaveSetting code, when i move i think im finished and i move to the next line i get the following messager
quote: Comile Error:
Expected: =
What am i doing wrong?
My SaveSetting Code is a followed
code: SaveSetting(app.ProductName, "LastVolLevel", SettingsLastVol)
app.productname is my application name
SettingsLastVol is the value from a Global variable that needs to be entered into the Value of that setting. I hope i explained myself properly.
Thanks in advance
RileyM
This post was edited on 09-08-2005 at 04:09 PM by Salem.
Was i Helpful?[/url]
|
|
09-08-2005 04:07 PM |
|
|
Dempsey
Scripting Contest Winner
http://AdamDempsey.net
Posts: 2395 Reputation: 53
38 / /
Joined: Jul 2003
|
RE: Settings in VB6 App Using Registry
remove the brackets and then it will work fine
|
|
09-08-2005 04:22 PM |
|
|
Salem
Senior Member
Posts: 769 Reputation: 16
37 / /
Joined: May 2004
|
O.P. RE: RE: Settings in VB6 App Using Registry
quote: Originally posted by Dempsey
remove the brackets and then it will work fine
Should i also remove the brackets from
code: value = GetSetting("MyAppName", "MySettingName")
Coz im am getting the following Error
" Complie Error: Argument Not optional" with the GetSetting part highlighted
This post was edited on 09-08-2005 at 04:31 PM by Salem.
Was i Helpful?[/url]
|
|
09-08-2005 04:26 PM |
|
|
Pages: (3):
« First
«
1
[ 2 ]
3
»
Last »
|
|