Registry API

Reading and writing to the registry tends to be a lot more difficult than it should be. An example is the RegCreateKeyEx() API, which clearly has too many parameters. With one function, you can create and open registry keys and set security permissions for registry keys. This can all be done in one call. This is nice if your performance is evaluated by how much you can accomplish with the least amount of code.

In Listing 8.1, I've coded a small C++ class, CRegistry, that removes most of the complexity from the registry APIs. This class has three functions that perform the three basic operations needed: setting values in the registry, retrieving values from the registry, and deleting registry keys. The class constructor automatically ...

Get COM+ Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.