Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2006

Tip: Looking for answers? Try searching our database.

Registry (or other example)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
poojo hackma - 29 Jun 2006 16:01 GMT
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.
poojo hackma - 29 Jun 2006 16:47 GMT
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.
poojo hackma - 29 Jun 2006 21:23 GMT
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?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.