• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

Getting a value from the registry

Hello,
I want to get a value from the registry. I can manage to do this when i don't specify a full path. But when I specify a path, it gives me an empty string. Why is this?

For example
This works : GetSetting("CLUB005C", "security", "test", "")
This Doesn't : GetSetting("CLUB005C", "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\CLUB005C\security\", "test", "")

The path is correct though.
Kind regards,
K
0
koeke
Asked:
koeke
1 Solution
 
Ryan ChongCommented:
GetSetting function actually point the Registry entry to:

\HKEY_CURRENT_USER\Software\VB and VBA Program Settings\ProgName, where ProgName is the application name as specified in the Project | Properties dialog in VB.

so when you add the "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\CLUB005C\security\", the registry path is not found.

See documentation at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbpj00/html/EasySettings.asp

so, to save/retrieve the value from different place in registry, you need to use core registry API.

Try grab some from:
http://www.vbcode.com/asp/code.asp?lstCategory=Registry

cheers
0
 
koekeAuthor Commented:
Thanks, It did help me solving my problem.
K.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now