Problem loading XML Document

Discussion in 'XML' started by evillanueva, Nov 16, 2005.

  1. evillanueva

    evillanueva Guest

    I've developed an application (in visual c++) which loads an XML
    Document as a configuration file. I'm using DOM 4.0 in Windows 2000.
    Sometimes when I make changes in the XML file and my application loads
    it, loads an old version of the xml file. The behaviour is as if the
    DomDocument object loaded a cached version of the Document. Has anyone
    experiment this behaviour?. The piece of code where I load the file is
    the following:

    CoInitialize(NULL);

    HRESULT hr = CoCreateInstance(__uuidof(DOMDocument40), NULL,
    CLSCTX_INPROC_SERVER,
    __uuidof(IXMLDOMDocument),(void**)&(m_pXMLDoc));

    if(SUCCEEDED(hr))
    {

    m_pXMLDoc->put_async(VARIANT_FALSE);
    m_pXMLDoc->put_validateOnParse(VARIANT_FALSE);
    m_pXMLDoc->put_resolveExternals(VARIANT_FALSE);

    VARIANT vXMLName;

    VariantInit(&vXMLName);

    CString xmlPath = m_strExePath +_T("Install.xml");

    vXMLName.vt= VT_BSTR;
    vXMLName.bstrVal = xmlPath.AllocSysString();

    VARIANT_BOOL status;


    m_pXMLDoc->load(vXMLName,&status);

    if(status == VARIANT_TRUE)
    {
    return TRUE;
    }
    else
    {
    return FALSE;
    }
    }

    Thanks in advance
     
    evillanueva, Nov 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Vukovich

    Problem Loading xml document

    Tom Vukovich, Aug 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    395
    Martin Honnen
    Aug 9, 2004
  2. Tony Prichard
    Replies:
    0
    Views:
    756
    Tony Prichard
    Dec 12, 2003
  3. Manish Hatwalne
    Replies:
    1
    Views:
    406
    Martin Honnen
    Jul 13, 2004
  4. Ion Freeman
    Replies:
    17
    Views:
    846
    Tom Anderson
    Jul 11, 2009
  5. ofir
    Replies:
    0
    Views:
    190
Loading...

Share This Page