CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2001
    Location
    USA
    Posts
    10

    How to read XML from C++

    Hi Code guru,

    I know Java that can read XML file. Can C++/VC++ 6.0 read XML file also?
    Please show me how or point me the website which I can learn from it.

    Thanks for your help,
    Have a nice day,

    Danh


  2. #2
    Join Date
    Nov 2001
    Posts
    2

    Re: How to read XML from C++

    #import "msxml.dll" named_guids
    using namespacing MSXML;

    ....

    IXMLDOMDocumentPtr pDoc;
    pDoc.CreateInstance( CLSID_DOMDocument );

    ....

    pDoc->load( .... )
    ....

    icq: 37175293
    oicq: 329170
    msn: [email protected]
    yahoo: rick1126

  3. #3
    Join Date
    Apr 2001
    Location
    SD, USA
    Posts
    9

    Re: How to read XML from C++

    Try this.


    MSXML2::IXMLDOMDocument2Ptr spDoc;
    spDoc.CreateInstance(__uuidof(MSXML2:OMDocument40));

    CComVariant varPath(L"D:\\example.xml");
    if(VARIANT_FALSE == spDoc->load(varPath))
    {
    ATLTRACE(_T("Load Document Failed!\n"));
    }





    qingqi song

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured