Below is the code that I am running and I am getting an error:
I already checked the uses
and it's fine.
I think it is a problem with the parameter of my AddSimpleElement()
procedure.
unit Unit9;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.OleServer,
QBXMLRP2Lib_TLB, MSXML, XMLDoc;
type
TForm9 = class(TForm)
btnSubscribe: TButton;
btnUnsubscribe: TButton;
rp21: TRequestProcessor2;
private
{ Private declarations }
procedure AddSimpleElement(doc : DOMDocument40; parent : IXMLDOMElement; name, value : String);
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
{$R *.dfm}
procedure AddSimpleElement(doc : DOMDocument40; parent : IXMLDOMElement; name, value : String);
var
newElem : IXMLDOMElement;
begin
newElem := doc.createElement(name);
newElem.text := value;
parent.appendChild(newElem);
end;
end.
See Question&Answers more detail:os