Microsoft Knowledge Base Email Alertz

KBAlertz.com: (251273) - 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.

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 251273 - Last Review: April 29, 2005 - Revision: 4.0

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

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:
Collapse this imageExpand this image
Download
Download NewXMLDOC.exe now (http://download.microsoft.com/download/vstudio60ent/sample/new/win98/en-us/newxmldoc.exe)
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  (http://kbalertz.com/Feedback.aspx?kbNumber=119591/EN-US/ ) 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.

Collapse this tableExpand this table
FileNameSize
CreateXMLDOMDocument.cpp4.71KB
CreateXMLDOMDocument.dsp4.40KB
CreateXMLDOMDocument.dsw565B


Notes
  1. The sample shows how to create a simple XML document with the following structure:
    <Customers>
       <customer id=345>
         <name FirstName="Jane" LastName="Doe"/>      
         <orders>
           <order Date=07/16/98 ProductName="Visual Basic" />
           <order Date=07/23/98 ProductName="Visual C++" />
         </orders>
      </customer>
    </Customers>
    					
  2. 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:
    1. XMLDocTreeBuilderInstrEnum: An enumeration that describes the node type.
    2. 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.
  3. Inline comments are available on major steps.
  4. 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.
  5. 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:
    #import "msxml.dll" 
    using namespace MSXML;
    
    and add following correspondingly:
    
    #import "msxml2.dll"  //msxml 2.6 parser
    using namespace MSXML2;
    
    or 
    
    #import "msxml3.dll"  //msxml 3.0 parser
    using namespace MSXML2;
    
    or
    
    #import "msxml4.dll" //msxml 4.0 parser
    using namespace MSXML2;
    						

APPLIES TO
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
  • Microsoft XML Core Services 4.0
  • Microsoft XML Parser 2.5
  • Microsoft XML Parser 2.6
  • Microsoft XML Parser 3.0
Keywords: 
kbhowto kbinfo kbdownload kbgraphxlinkcritical kbfile kbsample KB251273
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please