473,804 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Registry Access (Write Access)

MFC Application VC++.NET 2003

I have a certain registry key (HKCU\Software\ MyKey) that contains between 30
& 64 string values

I need to write a '*' to all those 30 - 64 string values under that
particular key.

Example:

HKCU\Software\M yKey

Key name Value

MyKey1 http://www.somesite.com
MyKey2 http://www.someothersite.com

Becomes:

MyKey1 *
MyKey2 *
....

Any ideas?

Have searched The Code Project & cannot make head not tail of these classes
as I am just starting back into C++ after many years

TIA
Apr 3 '07
20 3805

"Newbie Coder" <ne*********@sp ammeplease.comw rote in message
news:OY******** ******@TK2MSFTN GP06.phx.gbl...
Brian,

The function prototype is already defined in the RegisterEx.h file which
if
you see a few of my posts back the full header/cpp files I am using

I just want to be able to use that class in my MFC application like I
wrote
before in VB.NET:

Dim clsReg As New RegisterEx
clsReg.SetSomeV alue("bla", "bla", "bla")

Cheers,

--
Newbie Coder
(It's just a name)
I might be getting lost here. If your class is defined as:

class CRegisterEx
{
public:
CRegisterEx(CSt ring path);
~CRegisterEx(vo id);

void WriteString(CSt ring str, CString subPath = "", CString Key = "");
};

Simply add the new function as a member function of the class, as in:

class CRegisterEx
{
public:
CRegisterEx(CSt ring path);
~CRegisterEx(vo id);

void WriteString(CSt ring str, CString subPath = "", CString Key = "");
void RemoveSomeValue (_TCHAR *sValue);
};

The client code calling this function might look like:

CRegisterEx r ("F:\Mypath" );
r.RemoveSomeVal ue (_T("MyKey"));

Brian

Apr 9 '07 #21

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

Similar topics

2
436
by: Tim Blizard | last post by:
I know this topic has been discussed before but I couldn't find any thread more recent than about 18 months and was interested in what conclusions people had come to recently. Invariably 3 advantages of XML config files are promoted; 1. The .NET framework provides built-in support for reading application configuration data from .config files very easily 2. Using these files makes it possible to deploy an application using
2
2479
by: Dan Sikorsky | last post by:
Should application data be read and written to the Registry to persist state, or should the App.config file be used? If the Registry should be used, what .NET class reads and writes the Registry? If the App.config file should be used, reading a configuration setting is trivial, but there appears to be no write methtod. Please post a write method when replying. --
7
16520
by: Dennis C. Drumm | last post by:
Can my program access the HKEY_LOCAL_MACHINE/Software section of the registry when being used by a user with restricted rights (not with admin rights)? If so, how? I have a program that functions just fine when run by an administrator but generates an exception when run by a restricted user. The program accesses the HKEY_LOCAL_MACHINE/Software section to set or get application settings that are not user specific. Thanks,
3
1409
by: Martin | last post by:
Hi I am attempting to write a small application that will allow users to manage the AddressBar entries within Internet Explorer. The typed URLs in the AddressBar can be found at HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs and I have successfully managed to get this list via a Windows C# .NET app with the following code : public Form1()
1
1743
by: Yoshitha | last post by:
Hi I am developing web application through which i've to write and read the values from the registry. When i set impersonate property to "false" it is displaying exception " Requested Registry Access is not allowed" so then i changed impersonate to "true" and it is reading values from the registry and writing into the registry. but when i runing the same aplication in same system now am getting the exception "requested registry access...
8
5497
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(""))
3
5744
by: Nikolay Petrov | last post by:
Why I always get 'Requested registry access is not allowed' when i try to Read/Write to Windows Registry from ASP service. I use ASP NET account? Also granted full permissions to required Registry keys. What is the problem? TIA
3
18095
by: Dylan Parry | last post by:
Hi folks, I've just got a new machine at work, so I've spent all day copying across all of my work from my old machine. Now I've come across a problem that I've never seen before. I now get the following error when I attempt to run one of my sites: "Access to the registry key 'Global' is denied"
4
3283
by: Colin Priest | last post by:
I am trying to write a program to switch off serial port enumerations via the associated registry key. My code is: RegistryPermission permission = new RegistryPermission(RegistryPermissionAccess.Write, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum\\ACPI\\PNP0501"); permission.Demand(); RegistryKey key = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Enum\\ACPI\\PNP0501", true);
0
9705
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
9576
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10568
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10074
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
5516
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
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4292
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
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
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.