I am tryng to get this library working with thread but I am not able to get result back to the main thread using syncronize.
No problem creating xml within excute method.
Someone have used it?
TMyThread = class(TThread)
private
ADoc : TNativeXml;
protected
procedure Execute; override;
procedure DoProgress;
public
constructor Create(CreateSuspended: Boolean);
end;
{ TMyThread }
constructor TMyThread.Create(CreateSuspended: Boolean);
begin
inherited;
end;
procedure TMyThread.DoProgress;
begin
formMain.meminfo.Lines.Add(ADoc.WriteToString);
end;
procedure TMyThread.Execute;
var i,j : integer;
begin
inherited;
begin
ADoc:= ADoc.Create(formMain);
try
Adoc.XmlFormat := xfReadable;
ADoc.LoadFromFile('test.xml');
Synchronize(DoProgress);
finally
FreeAndNil(ADoc);
end;
end;
end;