473,387 Members | 1,515 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 (or other example)

Using Visual C++ 2005 Express (CLR):

I can't seem to find an example or documentation on how to read/write
information to the Registry.

Are Registry Settings now outdated? What else could I use to store things
like file locations, etc?

I'm coming from Borland C++ Builder, and I'm trying to learn how to work
with VC Express. Code, links, examples, and techniques are all appreciated.
Jun 29 '06 #1
2 868
I found a Registry example that I am working through.

Still, if there is a more accepted method of storing items like "recent
files" other than using the Registry or an INI file (very old), please let
me know.
Jun 29 '06 #2
Ok, I still need help here.

I tried this code:
//--------------------------------------
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
String^ strKey;
strKey = "Software\\Slick Co\\FancySoft 2";
RegistryKey^ rk = nullptr;
rk = Registry::CurrentUser->OpenSubKey(strKey);
if (rk) {
rk->Close();
}
}

protected:
~Form1()
{
String^ strKey;
strKey = "Software\\Slick Co\\FancySoft 2";
RegistryKey^ rk = nullptr;
rk = Registry::CurrentUser->OpenSubKey(strKey, true);
if (!rk)
{
rk->CreateSubKey(strKey);
}
if (rk)
{
rk->Close();
}
if (components)
{
delete components;
}
}
//------------------------------------

Even though sometimes the Registry Key is non-NULL, inspecting the Registry
afterwards in the HKCU Software section does not show any new settings.

Could someone throw me a bone here? People still use the Registry, don't
they? This can be done in Visual C++ 2005 Express (i.e. CLR), can't it?
Jun 29 '06 #3

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

Similar topics

8
by: Mark A | last post by:
Here is the description of a new feature in 8.2.2 (FP9) from the InfoCenter: "DB2_SKIPINSERTED registry variable You can use the DB2_SKIPINSERTED registry variable to skip uncommitted inserted...
8
by: Saradhi | last post by:
Can any one put me a piece of code to write binary data into Registry?
13
by: KV | last post by:
I'm new to OO Design, and I'm fixing to start writing my very first C# program. Given the complexity of OO programming, I would like to run something by this group and get general input. My...
0
by: ahaupt | last post by:
Hi all, I've created a setup project for my app in VS2003 and need to set up some registry values and keys. It is easy enough to just create static keys with static values, but I'd like the...
17
by: Sam | last post by:
Hi all If I only want to store screen location and size of my application in Windows Registry, which of the keys should I store this info? A sample code is greatly appreciated. Thank you ...
1
by: Jonny | last post by:
Hi All I am writing a small app that enumerates a certain registry key & then adds the key values to a listbox When I select one in the listbox & click the delete button I want to delete that...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to create a registry key, but orphan it from the program that created it? Reason: Create a key, but not associate it with the...
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 ...
1
by: somersbd | last post by:
I have a simple text file that I need to read and then write each line to the same key in the registry. Example: Text file name version.txt with the following lines HP 01/01/2008 4 and would...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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...

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.