Click here to Skip to main content
15,886,513 members
Articles / Desktop Programming / ATL

CM_ConfigBuilder 1.2g: Visual Studio 6/Visual Studio 2005/Visual Studio 2008 Code Generator for Application Settings Graphic Management

Rate me:
Please Sign up or sign in to vote.
4.94/5 (126 votes)
12 Feb 2008CPOL17 min read 696.4K   9.8K   262  
CM_ConfigBuilder generates and compiles the required files to manage your application's settings/preferences and to store/retrieve them in XML format.
// XmlSerializable.h
//

#if !defined(_XMLSERIALIZABLE_H_)
#define _XMLSERIALIZABLE_H_

#include "msxmlcpp.h"
#include <string>

using namespace std;

class CXmlSerializable
{
public:
	virtual bool BuildFromXml(CXMLDOMNode& node) = 0;
	virtual bool AppendToDOMDocument(CXMLDOMDocument2& xmlDoc, CXMLDOMElement& parentElement, bool parentIsValid = true) = 0;
	
	virtual bool SaveToXmlFile(const string& fileName);
	virtual bool LoadFromXmlFile(const string& fileName);

	virtual void Clear() = 0;
	virtual void SetDefaults() = 0;

	virtual string GetXmlNodeName();

protected:
	void AppendMemberNode(const string& nodeName, 
						 const string& nodeValue, 
						 CXMLDOMElement& parentElement,
						 CXMLDOMDocument2& xmlDoc);

	void AppendMemberNode(const string& nodeName, 
						 int nodeValue, 
						 CXMLDOMElement& parentElement,
						 CXMLDOMDocument2& xmlDoc);
	
	void AppendMemberNode(const string& nodeName, 
						  double nodeValue, 
						  int precision,
						  CXMLDOMElement& parentElement,
						  CXMLDOMDocument2& xmlDoc);
};

#endif //!defined(_XMLSERIALIZABLE_H_)

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Italy Italy
For all Stefano's latest code, binaries and tutorials visit www.codemachines.com

Comments and Discussions