Click here to Skip to main content
15,895,656 members
Articles / Programming Languages / C++

Writing Win32 Apps with C++: V2 - part 1

Rate me:
Please Sign up or sign in to vote.
4.70/5 (34 votes)
20 Jun 2005CPOL14 min read 107.9K   1.2K   73  
An independent framework to handle Win32 objects inside C++ classes.
/////////////////////////
//	w0.cpp

#include "stdafx.h"

#include "winx/xml.hpp"

using namespace GE_;



///////////////////////////////
//	WANING: since this is a windows program, to let the WINDOWS subsystem
//	to enter "main()", mainCRTStartup is declared as
//	module entry point for the linker.
//	

static LPCTSTR documenttext =
"<?xml version=\"1.0\"?>\n"
"<orders>\n"
"  <order order_number=\"2233\">\n"
"    <customer>\n"
"      <name>John Smith</name>\n"
"      <custID>192883</custID>\n"
"    </customer>\n"
"    <item>      \n"
"      <name>Fly Swatter</name>    \n"
"      <price>9.99</price>    \n"
"    </item>  \n"
"  </order> \n"
"  <order order_number=\"2234\">  \n"
"    <customer>   \n"
"      <name>Marea Angela Castaneda</name>      \n"
"      <custID>827145</custID>  \n"
"    </customer>    \n"
"    <item>    \n"
"      <name>Fly Paper</name>    \n"
"      <price>15.99</price>    \n"
"    </item>  \n"
"  </order>  \n"
"  <order order_number=\"2235\"> \n"
"    <customer>   \n"
"      <name>Amy Jones</name>      \n"
"      <custID>998022</custID>   \n"
"    </customer>   \n"
"    <item>      \n"
"      <name>Mosquito Netting</name>\n"
"      <price>38.99</price>    \n"
"    </item>\n"
"  </order>\n"
"</orders>\n"
;


int main()
{
	dbg::tracer::filter()=2;
	STRACE(trc, 2, ("w0 main\n"));
	
	xml::document doc;
	doc.parse(documenttext);

	xml::item::ptr p = doc.get_root()->seek("order", "order_number", "2234");

	winx::String text;
	doc.save_to_text(text);
	
	LPCTSTR txt(text);
	SRETRACE(trc, ("\n%s\n",txt)); 
}

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
Architect
Italy Italy
Born and living in Milan (Italy), I'm an engineer in electronics actually working in the ICT department of an important oil/gas & energy company as responsible for planning and engineering of ICT infrastructures.
Interested in programming since the '70s, today I still define architectures for the ICT, deploying dedicated specific client application for engineering purposes, working with C++, MFC, STL, and recently also C# and D.

Comments and Discussions