DCSIMG
MSXML - David Sackstein's Blog

Browse by Tags

All Tags » MSXML (RSS)

MSXML in C++ but as elegant as in C# (Part 6) by David Sackstein

OK, this is the last post on the subject. You can find the first post here and the previous one here . In this post, I want to show you how the tips and tricks we have been discussing make our C++ code quite elegant for the three projects we haven’t reviewed yet: XMLBuilder, XSDValidator and XSLTTransformer. As usual, my benchmark for elegance is a comparison with equivalent C# code, however in the last two projects, the code is not identical in the two languages due to differences in the COM and...
תגים:,

MSXML in C++ but as elegant as in C# (Part 5) by David Sackstein

Part 1 is the first post in this series. In Part 4 I described the first of the 5 project pairs provided with this article, DOMAndXPath. In this post I will review the second project – SAXReader. The SAX programming model is very different to the DOM model: SAX models the parser, whereas DOM models the XML document. SAX provides a forward only push model, where as DOM provides random access to nodes in the document. The SAXReader project is based on the MSDN example you can find here . It defines...
תגים:,

MSXML in C++ but as elegant as in C# (Part 4) by David Sackstein

Part 1 is the first post in this series. In Part 3 I described 3 simple steps that will help simplify your MSXML enabled C++ project. With those in place we are ready to examine each of the 5 project pairs provided with this article in more detail. Each project demonstrates how to implement a set of basic XML functions using MSXML in C++. In this post I will review the first of the five - DOMAndXPath. This project loads an XML file into a DOM, recursively traverses its nodes and displays them. It...
תגים:,

MSXML in C++ but as elegant as in C# (Part 3) by David Sackstein

See the previous posts for this article here: Part 1 , Part 2 . Before I review the projects for this article , I would like to describe the basics: a few simple steps that will give you a C# experience while programming MSXML with C++. Step 1: Import MSXML There are a number of ways to import com libraries in a C++ project. I think the simplest way is to add the following line in a common header (best precompiled). #import <msxml6.dll> named_guids This will create the headers (with extensions...
תגים:,

MSXML in C++ but as elegant as in C# (Part 2) by David Sackstein

So, in my opening post on this subject ( Part 1 ), I promised to show you some useful sample code using MSXML, written in C++ yet as elegant as C#. Well. Here is an example of what can be achieved. C++ C# #include "stdafx.h" inline void IndentedPrint ( int indent, char * format, ...) {     char m_Message[512];     va_list args;     va_start(args, format);     vsprintf_s(m_Message, format, args);     va_end(args);...
תגים:,

MSXML in C++ but as elegant as in C# (Part 1) by David Sackstein

Well, I did say that I would change subjects from time to time : ) This week I taught a class of C++ Programmers how to use MSXML and I sat down to write samples and demos for the lesson. Well, I love C++, but C# has spoiled me. Programming COM directly can get ugly and working with MSXML in C++ is no exception: all those AddRefs and Releases you need to call, HRESULTS you need to handle, and CLSIDs you need to find. Code that accesses COM directly is often error prone, difficult to understand and...
תגים:,
Powered by Community Server (Commercial Edition), by Telligent Systems