Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

A handy class to make use of Windows Registry

, 15 Aug 2004
Shows how simple accessing Windows Registry can be if you do not need bells and whistles.
simple_registry_demo.zip
a_better_example.exe
dirty_and_fast.exe
main.exe
with_trace.exe
simple_registry_src.zip
dirty_and_fast
dirty_and_fast.dsp
with_trace
with_trace.dsp
main.dsp
main.dsw
a_better_example
a_better_example.dsp
#include "registry.h"
#include <iostream>

class my_app{
protected:
	registry reg;
	registry::iterator UserName;
public:
	my_app():reg("Software\\Company"),UserName(reg["UserName"]){}
	~my_app(){}
	void SetUserName(const char * name){
		UserName = name;
	}
	const char * GetUserName(){
		return (const char *) UserName;
	}
};

int main (int, char *){
	my_app App;
	App.SetUserName("Alex");
	std::cout<<"The username is: "<<App.GetUserName()<<"\nThanks for playing..."<<std::endl;
	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

__PPS__

Canada Canada
Big Grin | :-D

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 16 Aug 2004
Article Copyright 2004 by __PPS__
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid