CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Using registry keys

    Is there any place to look for the functions I need to use to set and READ registry entries. CWinApp contains the SetRegistryKey() method but seems to have no facility to read them. Does this seem odd to anyone else? What good is setting a key if you never read it !?! Just wondering.

    Kyle


  2. #2
    Join Date
    May 1999
    Location
    Seattle, WA USA
    Posts
    423

    Re: Using registry keys

    There are a whole family of functions that start with Reg... I think RegQueryValue is the one you want.

    --michael


  3. #3
    Join Date
    Apr 1999
    Location
    Scottsdale, Arizona
    Posts
    28

    Re: Using registry keys

    The built-in registry functions can only read and write strings and ints. I've written a Registry class that can read and write any type of value (bool, short, string, double, etc.) Additionally, it takes care of error checking\handling as well. I can send you the source code for it tomorrow if you want. The class is very easy to use, as it takes care of all the internal details.

    example:
    Registry registry( key);
    bool b;
    double d;

    b = registry.read("value 1");
    d = registry.read("value 2");

    registry.write("value 3", "string value");
    registry.write("value 4", 99999);



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured