Import Microsoft XML 2.0

To register Microsoft XML, version 2.0 with Delphi, I choose Project | Import Type Library, find Microsoft XML version 2.0 (version 2.0), and click Install

I got many errors, like Undeclared identifier 'root', which points the root is not identified in the function below

function TXMLDocument.Get_root(out p: IXMLElement2): HResult;
begin
    Result := DefaultInterface.root[p];
end;

How to solve the problem?


Peter
petershaw9Asked:
Who is Participating?
 
Eddie ShipmanAll-around developerCommented:
Delphi 6 includes the file msxml.pas that is the wrapper for MS XML. just put msxml in your uses.
0
 
Imthiyaz_phCommented:
I tried importing XML 2.0 and its working for me. I m getting the ouput like this:

function TXMLDocument.Get_root(out p: IXMLElement2): HResult;
begin
    Result := DefaultInterface.Get_root(p);
end;
0
 
Eddie ShipmanAll-around developerCommented:
petershaw9,
   What version of Delphi are you using?
0
 
petershaw9Author Commented:
Delphi 6.
Acturally yesterday I changed the code to Result := DefaultInterface.Get_root(p); But the compiler said the parameter is not enough.

I installed the ms visual studio on my computer.

I have the following msxml files under \sindows\system32
msxml.dll     495K  4/8/2004 (d/m/yyyy)
mxxml2.dll   685K  4/8/2004
and some msxml3, 4, 6 etc.

Peter
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.