August 2003
Intermediate to advanced
624 pages
15h 3m
English
Let's look at how we create the Text Node and append it using MSXML from C++.
// Text Node <- Call Document's createTextNode method // with text from ColumnArray[ColumnNumber] // MSXML createTextNode specifies a BSTR for the // argument. Visual C++ is usually happy to convert // a char * but wanted an explicit cast for this // array element. IXMLDOMTextPtr spTexText = spDocOutput->createTextNode( (char *) cColumnArray[iColumnNumber]); // Column Element <- Call Column Element's appendChild // to add Text Node as child spEleColumn->appendChild(spTexText);
Again, this is very similar to the Java implementation. A “gotcha” here, as noted in the code comments, is that createTextNode requires that the text argument be a ...