Solved

Accessing Windows Registry

Posted on 1998-11-10
10
246 Views
Last Modified: 2010-04-02
Is there anyway I can add information into the Windows 95 registry using C++? If so, how?
0
Comment
Question by:GreatOne
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 4

Accepted Solution

by:
pagladasu earned 30 total points
ID: 1177482
Yes, you can.
Try the functions:
WriteProfileInt()
WriteProfileSection()
WriteProfileString()

0
 

Author Comment

by:GreatOne
ID: 1177483
What library would I have to include to use these functions?

0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1177484
What will you be using:
windows SDK or MFC

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:GreatOne
ID: 1177485
I am not using Visual C++, i am using DJGPP to write and compile my program. Can I access the Registry using DJGPP? If not, I would be using MFC.
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1177486
I have not used DJGPP. So, I wouldn't be able to tell.
0
 
LVL 1

Expert Comment

by:fstab
ID: 1177487
Use the registry functions : RegOpenKeyEx, RegCloseKey, RegCreateKeyEx, RegDeleteKey, RegOpenKey. The functions WriteProfileInt etc. write only into .INI files NOT the registry.

 

0
 

Author Comment

by:GreatOne
ID: 1177488
Fstab,
Can I use the functions u described with DJGPP?
0
 
LVL 1

Expert Comment

by:fstab
ID: 1177489
What is DJGPP ? :-) Please enlighten me ..
Also these functions are available in the Win32 environment. So if DJGPP supports the Win32 API, I am sure they should work. Otherwise you have an option of going back to MFC - actually these are not MFC functions but Win32 API functions.
0
 

Author Comment

by:GreatOne
ID: 1177490
Ok I am using Visual C++ to write this program. Using the functions listed by fstab how would I add a value to HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN?

0
 

Expert Comment

by:corneil
ID: 1177491
You have to open the key using:
RegOpenKeyEx
Then write the value using:
RegSetValueEx
Then close the registry key using:
RegCloseKey
            
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

730 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