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:
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: Settings in VB6 App Using Registry
No, you need the brackets on that line because you are setting the result of the function into a variable.

You are probably getting errors because you are only passing it two arguements and it needs three.
code:
value = GetSetting("MyAppName", ",Settings","MySettingName")
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-08-2005 04:31 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
No, you need the brackets on that line because you are setting the result of the function into a variable.

You are probably getting errors because you are only passing it two arguements and it needs three.
code:
value = GetSetting("MyAppName", ",Settings","MySettingName")



So what does the middle argument mean? What is it for?
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-08-2005 04:35 PM
Profile PM Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: Settings in VB6 App Using Registry
its the keyname you can call it whatever you want, but it obviously has to be the same in both your SaveSetting and GetSetting calls.

If you are saving options then aveing it something like Settings or Options makes logical sense.
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-08-2005 05:10 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
its the keyname you can call it whatever you want, but it obviously has to be the same in both your SaveSetting and GetSetting calls.

If you are saving options then aveing it something like Settings or Options makes logical sense.


I didn't use a keyname in the SaveSetting call? Should i, if so, should this also be the second argument?
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-08-2005 05:13 PM
Profile PM Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: Settings in VB6 App Using Registry
yes its the second arguement, 'Section'

[Image: attachment.php?pid=531687]

.png File Attachment: settings.PNG (4.81 KB)
This file has been downloaded 349 time(s).
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
09-08-2005 05:20 PM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Settings in VB6 App Using Registry
RileyM, please look in your help files...
Explaining everything about GetSetting/SaveSetting is too much. And explaining the registry API's is even much more to explain.

Put your cursor on "GetSetting" and/or "SaveSetting" in VB6 and press F1 to access the help files...

Or, in case you have an illegal version :rolleyes: you can also take a look at the msdn library which contains all the VB6 helpfiles. More specifically, the Visual Basic Document: Programmers Reference. There you'll find every command, statement, whatever you can use in VB6 with full detailed explanations (just as in the help files; heck, they are the helpfiles, but online).

eg:
SaveSetting
GetSetting
DeleteSetting
GetAllSettings


---------------

As for GetSetting/SaveSetting. This saves data to "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\*". But that registry path isn't much appreciated by many ("professional") people. If you can, don't use GetSetting/SaveSetting as they not only save data in a very obscure place, they also don't provide much flexibility. Use the registry API functions instead, but only if you know exactly what each function does and why and what the restrictions are etc. In other words, you need to know (almost) everything about the registry and its API's. This said, if you are making a private project (one which you aren't gonna distribute) you can do whatever you like of course.

---------------

Also, a very important note on the registry example modules/classes you'll find on the net for VB6. They all are roughly the same (no wonder, they all are copies from eachother without people even checking the API's and their funcionality and ins and outs!!!). They contain some errors and/or some minor glitches and don't always provide 100% compatibily with all Windows versions or even provide decent/correct functionality (yes, and I'm even speaking of the ones you'll find on sites like vbAccelerator, although they are correct for the most part, they often are very bloated... Codes you'll find on PSC are even worse and should never be taken as-is!)...

I say this because some time ago, I searched for some example registry module/class (because I was in a lazy mood). After finding out that everything you find on the net is a copy of eachother I began to wonder and studied the API's and registry and quickly came to the conclussion that all those sources can be optimized a lot and even contained some glitches (note: all this goes for many many... many example sources).

This post was edited on 09-08-2005 at 05:28 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-08-2005 05:20 PM
Profile PM 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 CookieRevised
RileyM, please look in your help files...
Explaining everything about GetSetting/SaveSetting is too much. And explaining the registry API's is even much more to explain.

Put your cursor on "GetSetting" and/or "SaveSetting" in VB6 and press F1...

Or, in case you have an illegal version :rolleyes: you can also take a look at the msdn library which contains all the VB6 helpfiles. More specifically, the Visual Basic Document: Programmers Reference. There you'll find every command, statement, whatever you can use in VB6 with full detailed explanations (just as in the help files; heck, they are the helpfiles, but online).

eg:
SaveSetting
GetSetting
DeleteSetting
GetAllSettings


---------------

As for GetSetting/SaveSetting. This saves data to "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\*". But that registry path isn't much appreciated by many ("professional") people. If you can, don't use GetSetting/SaveSetting as they not only save data in a very obscure place, they also don't provide much flexibility. Use the registry API functions instead, but only if you know exactly what each function does and why and what the restrictions are etc. In other words, you need to know (almost) everything about the registry and its API's. This said, if you are making a private project (one which you aren't gonna distribute) you can do whatever you like of course.

---------------

Also, a very important note on the registry example modules/classes you'll find on the net for VB6. They all are roughly the same (no wonder, they all are copies from eachother without people even checking the API's and their funcionality and ins and outs!!!). They contain some errors and/or some minor glitches and don't always provide 100% compatibily with all Windows versions (yes, and I'm even speaking of the ones you'll find on sites like vbAccelerator... Codes you'll find on PSC are even worse!)...

I say this because some time ago, I searched for some example registry module/class (because I was in a lazy mood). After finding out that everything you find on the net is a copy of eachother I began to wonder and studied the API's and registry and quickly came to the conclussion that all those sources can be optimized a lot and even contained some glitches (note: all this goes for many many... many example sources).


Thank-you for the suggestion, i will take a look at the VB Help (once i get arround to installing the MDSN documentaion, i do have the CDs i just ahven't bothered doing it yet).

Also sorry for asking so many questons regarding this, i have looked at the links provided earlier in this thread, but to be honest i didn't undertsand them at all, but the help i was given here did at least help with the very basics.

Thanks

RileyM
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
09-08-2005 05:28 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