Click here to Skip to main content
13,196,946 members (56,423 online)
Click here to Skip to main content

Stats

218.4K views
1.6K downloads
53 bookmarked
Posted 14 Sep 2002

Save Application Settings to XML

, 16 Sep 2002
An easy to use class that reads, writes and deletes app settings to an XML file.
// XmlSettingsTestDlg.h : header file
//

#if !defined(AFX_XMLSETTINGSTESTDLG_H__31392CFC_D7AF_4D9A_812D_7913A1A43E3B__INCLUDED_)
#define AFX_XMLSETTINGSTESTDLG_H__31392CFC_D7AF_4D9A_812D_7913A1A43E3B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "XMLSettings.h"

/////////////////////////////////////////////////////////////////////////////
// CXmlSettingsTestDlg dialog

class CXmlSettingsTestDlg : public CDialog
{
// Construction
public:
	CXmlSettingsTestDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CXmlSettingsTestDlg)
	enum { IDD = IDD_XMLSETTINGSTEST_DIALOG };
	CStatic	m_ValueStatic;
	CEdit	m_edValueName;
	CEdit	m_edValue;
	CEdit	m_edKeyPath;
	CEdit	m_edFilePath;
	CButton m_radioString;
	CButton m_radioLong;
	CButton m_radioRead;
	CButton m_radioWrite;
	CButton	m_radioDelete;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CXmlSettingsTestDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	CXMLSettings xmlSettings;

	// Generated message map functions
	//{{AFX_MSG(CXmlSettingsTestDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnStringradio();
	afx_msg void OnLongradio();
	afx_msg void OnReadradio();
	afx_msg void OnWriteradio();
	virtual void OnOK();
	afx_msg void OnView();
	afx_msg void OnDeleteradio();
	afx_msg void OnQuestion();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_XMLSETTINGSTESTDLG_H__31392CFC_D7AF_4D9A_812D_7913A1A43E3B__INCLUDED_)

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

Jason Henderson
Architect
United States United States
I have been a professional developer since 1996. I live in the middle of no where in Illinois, USA. I am married and have four children.

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171019.1 | Last Updated 17 Sep 2002
Article Copyright 2002 by Jason Henderson
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid