unit 2;
...
function setxml: TXMLDocument;
var xmldoc: TXMLDocument;
begin
xmldoc := TXMLDocument.create(nil);
xmldoc.addChild('DATA');
....
result := xmldoc;
end;
//=============================unit 1;
...
uese unit2;
....
....
var xmldoc :TXMLDocument;
begin
xmldoc := setxml;//但每次执行到这句时,都出错。end;
...
end.
换成procedure setxml(var xmldoc : TXMLDocument);也一样不行。
急,请高手指点。
...
function setxml: TXMLDocument;
var xmldoc: TXMLDocument;
begin
xmldoc := TXMLDocument.create(nil);
xmldoc.addChild('DATA');
....
result := xmldoc;
end;
//=============================unit 1;
...
uese unit2;
....
....
var xmldoc :TXMLDocument;
begin
xmldoc := setxml;//但每次执行到这句时,都出错。end;
...
end.
换成procedure setxml(var xmldoc : TXMLDocument);也一样不行。
急,请高手指点。
如xmldoc.savetoFile('cc.xml')等.
方法是正确的
看SDK去了
或者:setxml(xmldoc);
要么你函数function setxml: TXMLDocument;中可能有特殊的处理出错了,比较建立对象等等!