Microsoft KB Archive/251273

= How to create a new XMLDOM document when you use #import on Msxml.dll in Visual C++ =

Article ID: 251273

Article Last Modified on 4/29/2005

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft XML Core Services 4.0
 * Microsoft XML Parser 2.5
 * Microsoft XML Parser 2.6
 * Microsoft XML Core Services 4.0

-



This article was previously published under Q251273



SUMMARY
NewXMLDOC.exe is a Visual C++ sample that shows you how to create a new XMLDOM document from scratch when you use #import on Msxml.dll.



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

Download NewXMLDOC.exe now

Release Date: July 12, 2000

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. NewXMLDOC.exe contains the files listed in the following table.

Notes

  The sample shows how to create a simple XML document with the following structure:       Inside the sample, the majority of the work is accomplished within the BuildTree function. Notice that the sample also contains the following two structures that are defined to facilitate the building of the tree:  XMLDocTreeBuilderInstrEnum: An enumeration that describes the node type. XMLDocSourceData: The actual data used to create the node. The BuildTree function accepts an array of the XMLDocSourceData datatypes and uses this array to build XMLDOMDocument.</li></ol> </li> Inline comments are available on major steps.</li> On Windows NT 4.0 platform, if you download the NT 5.0 header files for XML samples and you get the following compiler errors:

c:\workshop\include\nt50\ocidl.h(3233) : error C2061: syntax error : identifier 'IPropertyBag'

You need to alter the order of the new Windows 2000 header directories to the end of the search path.</li>  The code sample uses #import on msxml.dll, which is for the MSXML 2.5 parser. If you have the MSXML 2.6 or MSXML 3.0 parser installed on the system, comment out the following code block: using namespace MSXML;
 * 1) import "msxml.dll"

and add following correspondingly:

using namespace MSXML2;
 * 1) import "msxml2.dll" //msxml 2.6 parser

or

using namespace MSXML2;
 * 1) import "msxml3.dll" //msxml 3.0 parser

or

using namespace MSXML2; </li></ol>
 * 1) import "msxml4.dll" //msxml 4.0 parser

Keywords: kbhowto kbinfo kbdownload kbgraphxlinkcritical kbfile kbsample KB251273

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.