问题
Recently we upgraded our code from Delphi 2009 to Delphi XE and updated our Indy components (not sure if this is relevant).
But ever since then we have had errors on Windows Server 2003 machines when loading and saving XML files.
XMLDoc.LoadFromFile()
XMLDoc.SaveToFile()
The DLL msvcrt.dll is much smaller on Windows Server 2003 (300kb or so) compared to over 600kb on other operating systems... So its missing something in that file and its causing the error...
Does anyone know how to fix this? Or is there an alternative to TXMLDocument
that I can try?
回答1:
By default, TXMLDocument
/IXMLDocument
is just a wrapper around the MSXML COM interfaces when running on Windows platforms. Neither TXMLDocument
nor Indy use the _ftol2_sse()
function, or even link to msvcrt.dll. Something else in your project is at fault.
回答2:
msvcrt.dll is (part of) the Microsoft Visual C++ Runtime. I think you got an older (or maybe even newer) version of this runtime that doesn't include this function.
Now you'll have to find out where this function is called. Do you link obj files with your project or use (other) 3rd party dll's?
回答3:
To answer the last part ("is there an alternative?"), you might want to check out Jedi Code Library's TJclSimpleXML
class. It does not require any external DLL, is quite fast, and is very easy to use. Besides, these days JCL and JVCL are a must-have anyway if you code in Delphi.
http://wiki.delphi-jedi.org/wiki/JEDI_Code_Library is their page I believe. I hear in seattle you can get it through IDEs integrated package manager.
来源:https://stackoverflow.com/questions/12900487/alternative-to-txmldocument