msxml::ixmldomdocument save method fails
-
I pass the full path of the file to the save function. returns "Unspecified error". What might be the problem?
-
I pass the full path of the file to the save function. returns "Unspecified error". What might be the problem?
What about dopcumentation? You should check the returned
HRESULT
value. This page [^] contains the following nice C++ example:BOOL DOMDocSaveLocation()
{
BOOL bResult = FALSE;
IXMLDOMDocument *pIXMLDOMDocument = NULL;
HRESULT hr;try
{
_variant_t varString = _T("D:\\sample.xml");
// Initialize pIXMLDOMDocument (create a DOMDocument).
// Load document.
hr = pIXMLDOMDocument->save(varString);
if(SUCCEEDED(hr))
bResult = TRUE;
}
catch(...)
{
DisplayErrorToUser();
// Release the IXMLDOMDocument interface.
}
// Release the IXMLDOMDocument interface when finished with it.
return bResult;
}:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
What about dopcumentation? You should check the returned
HRESULT
value. This page [^] contains the following nice C++ example:BOOL DOMDocSaveLocation()
{
BOOL bResult = FALSE;
IXMLDOMDocument *pIXMLDOMDocument = NULL;
HRESULT hr;try
{
_variant_t varString = _T("D:\\sample.xml");
// Initialize pIXMLDOMDocument (create a DOMDocument).
// Load document.
hr = pIXMLDOMDocument->save(varString);
if(SUCCEEDED(hr))
bResult = TRUE;
}
catch(...)
{
DisplayErrorToUser();
// Release the IXMLDOMDocument interface.
}
// Release the IXMLDOMDocument interface when finished with it.
return bResult;
}:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]