Solved

Registry interaction syntax

Posted on 1998-07-10
4
150 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
  • 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 100 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 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