?
Solved

Registry interaction syntax

Posted on 1998-07-10
4
Medium Priority
?
154 Views
Last Modified: 2012-05-04
I'm a novice VB programmer and I'm having trouble reading in a registry key value.  What I'm trying to achieve is to read in a string value located in:

HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\ApplicationName

This value specifies a drive letter.

Here is the syntax I'm trying to use:
G_Current_Drive =
GetSetting( "HKEY_LOCAL_MACHINE\SOFTWARE\Creativeware", "Job Start", "InitDrive")

where G_Current_Drive is a global string variable.

After the user selects another drive letter, I want the program to update the value in the registry, so when the user runs the application and has to choose a drive letter again, it goes back to the last drive letter they were in.

I'm trying to use the "GetSetting" function to retrieve this key, but I can't seem to get it to work.  Am I on the right track?  I would be grateful for any advice or solutions.  Thanks in advance.
0
Comment
Question by:hwilson
[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
  • 3
4 Comments
 

Author Comment

by:hwilson
ID: 1465479
Edited text of question
0
 

Author Comment

by:hwilson
ID: 1465480
Edited text of question
0
 
LVL 6

Accepted Solution

by:
alamo earned 400 total points
ID: 1465481
The GetSetting keyword doesn't allow access to the entire registry - only HKEY_CURRENT_USER\Software\VB and VBA Program Settings\appname\section\key
and thus the hierarchical keys you specify won't work.

there is a Knowledge Base article which describes how to do this, with examples. See it on the web at http://support.microsoft.com/support/kb/articles/q145/6/79.asp If you need more details or have questions on any of this, just ask.

Hope this helps!
0
 

Author Comment

by:hwilson
ID: 1465482
I found the answer at the exact same URL.  Thanks though.

Herbie
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 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