What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Settings in VB6 App Using Registry

Pages: (3): « First « 1 [ 2 ] 3 » Last »
Settings in VB6 App Using Registry
Author: Message:
Salem
Senior Member
****

Avatar

Posts: 769
Reputation: 16
37 / Male / Flag
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
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-07-2005 07:43 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
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.
[Image: spartaafk.png]
09-07-2005 07:56 PM
Profile PM Web Find Quote Report
Salem
Senior Member
****

Avatar

Posts: 769
Reputation: 16
37 / Male / Flag
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.
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-07-2005 07:58 PM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
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.
[Image: spartaafk.png]
09-07-2005 08:00 PM
Profile PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
38 / Male / Flag
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
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-07-2005 08:02 PM
Profile E-Mail PM Web Find Quote Report
Salem
Senior Member
****

Avatar

Posts: 769
Reputation: 16
37 / Male / Flag
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
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-07-2005 08:04 PM
Profile PM Find Quote Report
Millenium_edition
Veteran Member
*****

Avatar

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
Profile E-Mail PM Find Quote Report
Salem
Senior Member
****

Avatar

Posts: 769
Reputation: 16
37 / Male / Flag
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.
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-08-2005 04:07 PM
Profile PM Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
38 / Male / Flag
Joined: Jul 2003
RE: Settings in VB6 App Using Registry
remove the brackets and then it will work fine
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-08-2005 04:22 PM
Profile E-Mail PM Web Find Quote Report
Salem
Senior Member
****

Avatar

Posts: 769
Reputation: 16
37 / Male / Flag
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.
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-08-2005 04:26 PM
Profile PM Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On