When I create a TXMLDoucument oject with the constructor with a file path, it is not parsed and I got "Invalid pointer operation" when running the following code.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
String filePath="C:\\Users\\Maksim\\Documents\\SteelList.xml";
TXMLDocument* xmlDoc=new TXMLDocument(filePath);
xmlDoc->DOMVendor=GetDOMVendor("MSXML");
xmlDoc->Active=true;
String nodeName=xmlDoc->DocumentElement->GetNodeName();
ShowMessage(nodeName);
}
However when I create a TXMLDocument oject with the constructor with an Owner parameter, the following code works fine.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
String filePath="C:\\Users\\Maksim\\Documents\\SteelList.xml";
TXMLDocument* xmlDoc=new TXMLDocument(this);
xmlDoc->FileName=filePath;
xmlDoc->DOMVendor=GetDOMVendor("MSXML");
xmlDoc->Active=true;
String nodeName=xmlDoc->DocumentElement->GetNodeName();
ShowMessage(nodeName);
}