var
Vxmldocument:txmldocument;
Begin
Vxmldocument: = Txmldocument.create (' C:/temp/temp.xml ');
Caption: = IntToStr (VXMLDocument.Node.ChildNodes.Count);
Vxmldocument.free;
End;Execute the above code to jump out of "Invalid pointer operation" exceptionfound shielding vxmldocument.free; it's normal again.Trace Kernel code vxmldocument was released two times it's not clear why there's no way to search the code everywhere.then place a txmldocument control directly on the formThis piece of code doesn't go wrong.Depressed, the only difference is the placement of the control assigned to the owner, Direct txmldocument.create (' c:/temp/temp.xml '); no assignment owner okay, first of all, fix it.Var
Vxmldocument:txmldocument;
Begin
Vxmldocument: = Txmldocument.create (self);
Vxmldocument.filename: = ' c:/temp/temp.xml ';
Vxmldocument.active: = True;
Caption: = IntToStr (VXMLDocument.Node.ChildNodes.Count);
Vxmldocument.free;
End
That's what it looks like, but it's all based on experience.how to deal with the VCL kernel still needs to be analyzedhttp://blog.csdn.net/zswang/article/details/1610404
The experience of dynamically invoking Txmldocument in Delphi