5

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 following is the error

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?

bluish
  • 26,356
  • 27
  • 122
  • 180
Trevor
  • 16,080
  • 9
  • 52
  • 83
  • 1
    take a look at NativeXML or OmniXML parsers – teran Oct 15 '12 at 17:07
  • 1
    Have you worked out why that floating point related function is referenced? Sounds like you need to submit a qc report. – David Heffernan Oct 15 '12 at 17:17
  • 2
    This often happened to me in apps that depend on the Microsoft XML runtime. Having an old version of MS XML will cause this. The fact that this happens to you on Windows 2003 Servers indicates to me that you should be checking your MS XML on there and upgrading it. However, since this kind of crap makes me mad, I have since removed all usage of MSXML and I no longer have any worries about MS XML. I use OmniXML. – Warren P Oct 15 '12 at 17:20
  • Thank you for the help, I think at this point I will just try using NativeXML or OmniXML. – Trevor Oct 15 '12 at 18:04
  • Well I don't know if NativeXML or OmniXML is going to be the best solution for me, while trying to implement it I found we are using a huge data binding file which references GetDocBinding in XMLIntf but I can't find anything similar in NativeXML or OmniXML. – Trevor Oct 15 '12 at 19:37
  • if u chanced to have Jedi Code Library it also has XML parser – Arioch 'The Oct 15 '12 at 20:10
  • since server 2003 is almost the same as XP, i'd try to install or put into exe folder a dLL that works on other computers. Of course if MSXML.dll does not use WinSxS - but msvcrt.dll is so really old library - it should not be placed in WinSxS – Arioch 'The Oct 15 '12 at 20:14
  • Okay I updated my question to give you an update on what I'm trying to do now. David I would love to find out why that floating point related function is being referenced, but I don't know how to figure that out. I don't think the error is even detrimental because after the error message shows up the program seems to run fine. – Trevor Oct 15 '12 at 20:37
  • Try updating to latest MSXML and see if that changes anything. Additionally, if you (or your administrator) haven't done so, try updating Windows Server 2003 itself. There may be some updates explicitly related to MSXML. You should have v6.0, which you can't download here: http://www.microsoft.com/en-us/download/details.aspx?id=3988 – LightBulb Oct 15 '12 at 22:10
  • 1
    msvcrt.dll comes with ms visual c++ runtime Redistributable, so installing a proper restributable is better than just including the dll. Using the restributable also adheres with microsoft licensing. – Hendra Oct 16 '12 at 06:20
  • @Hendra No that is not true. msvcrt.dll is the CRT which ships with Windows. – David Heffernan Oct 16 '12 at 07:31
  • 1
    @Trevor Your update should be a new question. Please revert this question and ask new question. – David Heffernan Oct 16 '12 at 07:32
  • 1
    At this point I would build a small test app that does very little other then load a XML document and save a XML document and see if you get the same result. If you do then it is a update issue as everyone above has stated. if not youve got somthing else happening in your app. – Jeremy Evans Oct 16 '12 at 14:25
  • @David, msvcrt.dll is included in windows itself, but msvcrt.dll is a Microsoft Visual C ++ Runtime. Look at the name of the dll(MS stands for Microsoft, VC stands for Visual C++, RT stands for Run Time). If you put together MS, VC, and RT it becomes MSVCRT.DLL. What I am saying is this: OP is developing on a machine with msvcrt.dll version newer than msvcrt.dll on the target machine (Win2003). Now, to get a proper updated msvcrt.dll, it is better to install decent Microsoft VC++ Runtime Restributable (for example MS VC++ 2010 Runtime Restributable) which has _ftol2_sse() function in it. – Hendra Oct 17 '12 at 05:50
  • @Hendra 2010 CRT is not named msvcrt.dll. It's msvcrt100.dll. My point is that msvcrt.dll is a system component that is never changed by installing an MSVC runtime. I suggest you read my answer to Trevor's latest question. – David Heffernan Oct 17 '12 at 06:23

3 Answers3

3

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Okay well, I used show messages to track down where the error occurs and that same error message shows up during both XMLDoc.LoadFromFile() and XMLDoc.SaveToFile(). Now is it possible this error is occurring before these lines and just does not show up until then or something? – Trevor Oct 15 '12 at 21:06
  • I don't have access to a windows 2003 server where I can debug my code on it. Do you have any tips on how I might track down what is calling _ftol2_sse ? – Trevor Oct 15 '12 at 21:13
  • Okay so your right I determined that XMLDoc.LoadFromFile() XMLDoc.SaveToFile() aren't necessarily the cause of the problem i'm having a really hard time tracking down where and why this issue is occurring. – Trevor Oct 16 '12 at 19:07
1

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?

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
1

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.

Tuncay Göncüoğlu
  • 1,699
  • 17
  • 21