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
Solved

Accessing Windows Registry

Posted on 1998-11-10
10
238 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
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.

 

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

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

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