我将我的 Delphi 7 代码迁移到 Delphi XE4。我在 Delphi XE4 中的 LoadFromSram 方法中遇到错误,但在 Delphi 7 中同样可以正常工作。
错误:
First chance exception at $7559C41F. Exception class EDOMParseError with message
'XML document must have a top level element.
Line: 0
'.
Process abc.exe (10516)
var
myStream : TStream;
....
....
LoadFromStream(myStream);
我在 uses 子句中使用 XMLDoc、XMLIntf、XMLDOM。