Click here to Skip to main content
12,455,073 members (62,076 online)
Click here to Skip to main content

Stats

74.3K views
1.9K downloads
28 bookmarked
Posted

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.
a_better_example.exe
dirty_and_fast.exe
main.exe
with_trace.exe
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

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 16 Aug 2004
Article Copyright 2004 by __PPS__
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid