Solved

Accessing Windows Registry

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

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ - Convert a wString to char * 9 518
Template syntax for variable length arrays 9 71
Should CArray be used for a list of pointers in C++? 19 97
How to split this in C++ 4 94
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

864 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now