Solved

Accessing Windows Registry

Posted on 1998-11-10
10
251 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
[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
  • 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
Technology Partners: 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

Technology Partners: 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!

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

718 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