473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to add a new registry key of type string to registry

hai,

i am developing an vc++ application.

For this application i have to create a new string type key in the
registry.

i know that, RegCreateKey and RegCreateKeyEx fuctions can be used
to create the new value.

but i am unable to succeed on those. so can you give me an example
for this one ?
Regards,
kumar.
Nov 17 '05 #1
2 1992
"kumar" <ku***@nannacomputers.com> wrote in message
news:ui*************@tk2msftngp13.phx.gbl...
[responding out of order to post]
but i am unable to succeed on those. so can you give me an
example for this one ?
Well, it is always good to describe a _little_ about what you have tried and
how it failed.
For this application i have to create a new string type key in
the registry.

i know that, RegCreateKey and RegCreateKeyEx fuctions can be used
to create the new value.


Just so there is no confusion, do you know the difference between keys and
values? Are you creating a new key or a new string value on an existing key.
If you are creating a new key then of what key is yours a subkey? If you
describe a little of the key structure you need, I'm sure someone here can
sketch what you need to do.

Finally, note that the shell provides a set of simplified (if somewhat
inefficient) functions for common registry updates. The functions all have
names like SHRegxxx

Regards,
Will
Nov 17 '05 #2
If you use ATL or MFC... (error handling omitted)

CRegKey regkey;
LONG lErr = regkey.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_WRITE); // new
Key

lErr = regkey.Create(regkey.m_hKey, L"blahkey");

lErr = regkey.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE\\blahkey", KEY_WRITE);

lErr = regkey.SetStringValue(L"newValue", L"theValue"); // new string value



Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bo | last post by:
I am using RegistryKey.GetValue() method to retrieve values from Windows Registry. I don't know how to read type REG_MULTI_SZ into a string array. I have tried string array = (string)...
10
by: Clint | last post by:
Hey all - I'm having a really confusing problem concerning a web service. Right now, I have an application that needs to call a web service that does nothing but return "true" (this will...
6
by: CMG | last post by:
I am writing a little code to associate an extention with my program. And as far as i can see, i need to do the following: Public Function associatefile(ByVal FILE_EXTENTION_TO_ASSOCIATE As...
4
by: LP | last post by:
Hi, My webservice is currently deployed on WIndows 2000 server and runs pretty fine. I am trying to run my webservice on a Windows 2003 server. My webservice tries to write to a eventlog. The...
5
by: Dave | last post by:
I'd like to create a Registry key value where the Registry key value type is REG_QWORD. I'm using SetValue(name As String, value As Object), and I understand that the object type used in this...
0
by: Shane | last post by:
Does anyone have any advise on how I can fix the error message shown below? Thanks in advance for any ideas, Shane Server Error in '/' Application....
5
by: Ankit Aneja | last post by:
This is my problem. I am using Visual 2003, .Net framework 1.1 and the Application Block I configured the DAAB using the Enterprise Library Configuration now this is the error which is coming ...
9
by: Newbie Coder | last post by:
Hello Newsgroup Readers I would like to know how to go & do the following: I have a certain registry key that has sub values Example: Key1 http://www.microsoft.com Key2 ...
11
by: Unknown Hero | last post by:
Tim Golden wrote: The first link which points to the Python documentation for the _winreg module I already checked, even before coming here. I am wondering how I should do the loop I need (go...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.