473,387 Members | 1,463 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,387 software developers and data experts.

Registry Help

C++ Guru's..

I need some help please. I've been reading the C++ in 21 days by
James Liberty. Currently I'm on Chapter 7 (looping). This knowledge
doesn't have anything really to do with my question; it's more to show
you that I'm a rookie learning C++.

I have an opportunity to write a simple application for my work and
I'd like to write my very first non-book tutorial application.

I need to be able to check to see if a particular key's value exists
and if not then write the key to the registery.

The Key I need to check for an existing value is:
KEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tc pip\Parameters

The DWORD Value I need to check for is:
DisableDHCPMediaSense with a value of 1

So, common sense tells me to go to the MSDN materials at Microsoft. I
found the registry api information here:
http://msdn.microsoft.com/library/de..._functions.asp

However, I don't understand how to plug this into my programs logic?

For example.. I know how to form the IF and ELSE together, but I don't
understand how I take the Registry API and make it work the C++ within
my IF and ELSE.

In your reply, please don't suggest using another langaguage such as
VBScript or JavaScript. My goal is to learn C++. ;) Also, please do
not solve my problem but give me hints on how to apply it. The MSDN
information I've found hasn't given me a good enough hint yet or how
to put this all together.

Thanks for everyone's time!

Jon
Jul 19 '05 #1
1 3194


merc wrote:


For example.. I know how to form the IF and ELSE together, but I don't
understand how I take the Registry API and make it work the C++ within
my IF and ELSE.

In your reply, please don't suggest using another langaguage such as
VBScript or JavaScript. My goal is to learn C++. ;)


But your problem is not related to C++. Your problem is related
to: How do I program for the Windows Environment (in particular
the subsystem of Windows which handles the Registry). Thus
you need to ask in a newsgroup about Windows programming.
The Micorsoft newsserver holds such groups. ( point your
newsreader to msnews.microsoft.com)
The FAQ has additional information on finding informations:
http://snurse-l.org/acllc-c++/faq.html

Another hint: There are already code snippets available for simplifying
your problem. The encapsulate the registry access in a nicer and easier
to use way.

You might also want to search some dedicated web-sites for
windows programming and use them as a sort of source code
repository:
www.codeguru.com
www.codeproject.com

PS: The way your question is formulated makes me come up with
a warning: Programming Windows isn't that easy. You might continue
your studies on standard C++, until you feel confident in just the
plain language. Only then move on to the next step. Also: You definitly
will need a book on Windows programming, as you needed a book for C++
programming.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #2

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

Similar topics

0
by: vincemoon | last post by:
Below is an excerpt from my Registry Log, created by Redmon, showing the process whereby TweakUI added the compressed folder option to the new sub-menu in the right click context menu for open...
5
by: RWC | last post by:
Hi! I'm having a problem in A2K2. This should be simple, but I can't really figure it out. First problem, I'm trying to set the property of a table, via Vb to hidden, and I aslo would like to...
21
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing...
8
by: Al Kaufman | last post by:
I have a simple console app that uses: regSubKey = <some registry key> Dim reg As RegistryKey = Registry.ClassesRoot.OpenSubKey(regSubKey) Dim path As String path = CStr(reg.GetValue(""))
4
by: Bob | last post by:
My question about how to add an assembly search path to VS.NET's IDE remains unanswered, but I'm still faced with a problem possibly associated with this: my exported registry is more than 67MB....
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
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 ...
3
by: Rymfax | last post by:
Hello, I was hoping someone could help me with a problem I'm having. I've got a C# app that uses several DLL Imports from setupapi.dll and others (Thanks again for the Help on those Willy). One...
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...
3
by: thephatp | last post by:
BLUF: I need to build up the actual %TEMP% path for all users methodically using values in the registry, and I need to do this both by the current user AND as a service will do this running as...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.