?
Solved

Getting a value from the registry

Posted on 2003-03-28
2
Medium Priority
?
164 Views
Last Modified: 2010-05-01
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
Comment
Question by:koeke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 150 total points
ID: 8223769
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
 

Author Comment

by:koeke
ID: 8237441
Thanks, It did help me solving my problem.
K.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question