xmlfile load failed
Hi,
I`ve a strange problem, according to my xmlfile load function (it
always works; but today it always fails: I didn`t change anything on
the xmfile load code.
If I try to debug the load method always fails on my computer (but
that`s the only computer where it failed); if I start the exe without
the use of visual studio everything works as expected (the xmfile will
be loaded - no problems). I`ve tried to debug this project on another
computer and it works (without failing to load the file).
In the debug window I get some first-chance exceptions by calling this
line:
vResult = m_pXMLDoc->load(bstrFileName);
1. First chance exception: NT_close was called
2. wininet.dll and normaliz.dll will be unloaded again
The xmlfile is definitely available. If tried to start an earlier
version of my programm which was working on this computer (also
loading the xmlfile) - now it also failed....
I also tried to reinstall my visual studio programm (replace both dlls
(normaliz.dll and winit.dll by using them from another computer) - but
it also doesn`t help....
Maybe you have some hints to find the problem... at the moment I`ve no
idea where it could be.... maybe there`s a option in my visual studio
which will avoid loading the xmlfile... Or is there a method to get
all default values in visual studio?
Here`s my method to load the xmlfile
{
MSXML2::IXMLDOMDocument2Ptr m_pXMLDoc;
MSXML2::IXMLDOMElementPtr m_pDocRoot;
// Create the XML Document
HRESULT hr = m_pXMLDoc.CreateInstance(CLSID_DOMDocument);
if (FAILED(hr))
{
_com_error er(hr);
AfxMessageBox(er.ErrorMessage());
return FALSE;
}
// convert xml file name string to something COM can
handle (BSTR)
_bstr_t bstrFileName;
bstrFileName = strFileName.AllocSysString();
XmlFileName = strFileName;
variant_t vResult;
vResult = m_pXMLDoc->load(bstrFileName);
if (((bool)vResult) == TRUE) // success!
{// now that the document is loaded, we need to initialize the root
pointer
m_pDocRoot = m_pXMLDoc->documentElement;
}
else
{
AfxMessageBox(_T("XML File FAILED to load!"));
return FALSE;
}
}
best regards
Hans