473,797 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_MACHI NE\SYSTEM\Contr olSet001\Servic es\Tcpip\Parame ters

The DWORD Value I need to check for is:
DisableDHCPMedi aSense 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 3223


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.microsof t.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
354
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 folders and desktop. I hope someone can help me to better understand what this log excerpt means, or point me to info sources that do a good job of explaining how to interpret exactly what the various phrases, words, and numbers in the log mean.
5
3300
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 update the Description as well. For some reason I can't seem to find any reference to doing this in the online help. Also, second part; I would like to find out more about reading, adding and editing a registry entry via Access / VB. Although...
21
10836
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 System.SecurityException. Also of note: Sitting at my local box, I can open regedit and connect to the remote registry. I see three hives: _CLASSES_ROOT, _LOCAL_MACHINE, and _USERS. I can open all but HKEY_LOCAL_MACHINE. When I try to expand that...
8
5495
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
1389
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. This seems much too large to be normal, even for a developer's machine. I've read in places that "it's not recommended that you register assemblies in the GAC when developing addins", yet the instructions for adding a path the IDE configuration...
6
1682
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 object with 10 string items into the registry and retreive them later. I tried this: key.SetValue("lstNSXitems", lstNSX.Items) where "lstNSXitems" is the name of the subkey, and lstNSX.Items is the
9
2090
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 http://www.sarc.com
3
2166
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 import in particular is SetupDiBuildDriverInfoList(), which builds a list of potential drivers for a piece of hardware. This function uses the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion \DevicePath value key to determine which...
11
7559
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 through HKEY_LOCAL_MACHINE and read one subkey at a time, if it contains this 'foo' then change it into 'moo'). As I already said, I am by no means an expert in Python (heck, I learned the basics only a month ago). However, I am willing to learn.
3
1648
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 "Local System." Thus, I can't rely on it always being ...\<Username>\Local Settings\Temp. So, this partially applies to C#, because I'll need to do this in C# code. But, I think I already know how to do it. What I don't know is where to find...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10245
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10205
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.