Click here to Skip to main content
14,085,597 members
Click here to Skip to main content

Stats

34.2K views
29 bookmarked
Posted 12 Apr 2016
Licenced Ms-PL

Linq-To-XML Style of Node Creation for C++

, 12 Apr 2016
Linq-To-XML Node Creation for Native C++
BuildProcessTemplates
Elmax.vsmdi
ElmaxNet
Properties
Elmax
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
StringUtils
Local.testsettings
TestNativeElmax
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax
Properties
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
TryoutNet
Properties
Tryout
res
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
Elmax.vsmdi
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
Local.testsettings
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
Elmax.vsmdi
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
Local.testsettings
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
Elmax.vsmdi
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
Local.testsettings
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
Elmax.vsmdi
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
Local.testsettings
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
Elmax.vsmdi
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
Local.testsettings
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
Elmax-ver089
Elmax.vsmdi
Elmax
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
StringUtils
ElmaxNet
Properties
Local.testsettings
TestNativeElmax
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax
Properties
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout
res
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
TryoutNet
Properties
Elmax.vsmdi
Elmax.vcxproj.user
Elmax_2005.vcproj
Elmax_2008.vcproj
Local.testsettings
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout.ico
Tryout.vcproj
Tryout.vcxproj.user
Tryout_2008.vcproj
// TryoutDlg.h : header file
//

#pragma once

#include "..\\Elmax\\Element.h"
#include "..\\Elmax\\HyperElement.h"
#include "..\\Elmax\\Document.h"

#include "..\\Elmax\\NewElement.h"
#include "..\\Elmax\\NewAttribute.h"
#include "..\\Elmax\\NewComment.h"
#include "..\\Elmax\\NewCData.h"

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

// Dialog Data
	enum { IDD = IDD_TRYOUT_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

	HRESULT CreateAndInitDom(MSXML2::IXMLDOMDocumentPtr& pDoc);
	HRESULT OpenDOMFile(MSXML2::IXMLDOMDocumentPtr& pDoc, const std::wstring& szFile);

	bool SaveXml(MSXML2::IXMLDOMDocumentPtr& pDoc, const std::wstring& strFilename);
	bool PrettySaveXml(MSXML2::IXMLDOMDocumentPtr& pDoc, const std::wstring& strFilename);
	bool CreateAndLoadXml(MSXML2::IXMLDOMDocumentPtr& pDoc, const std::wstring& strFilename);
	bool DeleteFile(const std::wstring& strFilename);

	void TestWrite();
	void TestRead();

	void TestWrite2();
	void TestWrite3();
	void TestWrite4();
#if (_MSC_VER >= 1700 )
	void TestWrite5();
#endif

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
};

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 Microsoft Public License (Ms-PL)

Share

About the Author

Shao Voon Wong
Software Developer (Senior)
Singapore Singapore
Shao Voon is from Singapore. His CodeProject contributions could range from being used in game changer Large Hadron Collider (LHC) of CERN to smash particles to something as frivolous as Maplestory game to as life changing as electrocardiography(ECG) project to everyday indispensable Irfanview image viewer.

CodeProject bestowed him a MVP award in recognition of his article contributions in 2019. In his spare time, he prefers to writing application based on 3rd party library than writing his own open source library. His interest lies primarily in computer graphics, software optimization, security and Agile methodologies.

One of these days, you can find him working on a DirectX based slideshow app called Mandy Frenzy.

You can reach him by sending a message on CodeProject or at his Coding Tidbit Blog!

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.190518.1 | Last Updated 12 Apr 2016
Article Copyright 2016 by Shao Voon Wong
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid