acartus
asked on
Undeclared Identifier: 'GetTypeInfoCount', 'GetTypeInfo', 'GetIDsOfNames', 'Invoke' msxml
I am a BEGINNER to Delphi and Pascal. I am trying to implement a sax parser but am getting the following compiler errors:
Undeclared Identifier: 'GetTypeInfoCount'
Undeclared Identifier: 'GetTypeInfo'
Undeclared Identifier: 'GetIDsOfNames'
Undeclared Identifier: 'Invoke'
I have had this problem for days and have been searching for a solution. I've tried workarounds or different ways to implement a sax parser to no avail. PLEASE HELP!!!
I'm just trying to implement the IVBSAXContentHandler class. I imported the type library C:\WINDOWS\system32\msxml4 .dll.
Below is a basic .pas file to try and get things to compile, any help would be greatly appreciated! Thanks!
unit Test;
interface
uses MSXML2_TLB;
type
//======================== ========== ========== ========== ========== ========== ====
// SAX Content Handler
//======================== ========== ========== ========== ========== ========== ====
TSAXContentHandler = class(TInterfacedObject, IVBSAXContentHandler)
public
constructor Create();
procedure Set_documentLocator(const Param1: IVBSAXLocator); safecall;
procedure startDocument; safecall;
procedure endDocument; safecall;
procedure startPrefixMapping(var strPrefix: WideString; var strURI: WideString); safecall;
procedure endPrefixMapping(var strPrefix: WideString); safecall;
procedure startElement(var strNamespaceURI: WideString; var strLocalName: WideString;
var strQName: WideString; const oAttributes: IVBSAXAttributes); safecall;
procedure endElement(var strNamespaceURI: WideString; var strLocalName: WideString;
var strQName: WideString); safecall;
procedure characters(var strChars: WideString); safecall;
procedure ignorableWhitespace(var strChars: WideString); safecall;
procedure processingInstruction(var strTarget: WideString; var strData: WideString); safecall;
procedure skippedEntity(var strName: WideString); safecall;
property documentLocator: IVBSAXLocator write Set_documentLocator;
end;
implementation
//======================== ========== ========== ========== ========== ========== ====
// SAX Content Handler
//======================== ========== ========== ========== ========== ========== ====
constructor TSAXContentHandler.Create( );
begin
end;
procedure TSAXContentHandler.Set_doc umentLocat or(const Param1: IVBSAXLocator);
begin
end;
procedure TSAXContentHandler.startDo cument();
begin
end;
procedure TSAXContentHandler.endDocu ment();
begin
end;
procedure TSAXContentHandler.startPr efixMappin g(var strPrefix: WideString;var strURI: WideString);
begin
end;
procedure TSAXContentHandler.endPref ixMapping( var strPrefix: WideString);
begin
end;
procedure TSAXContentHandler.startEl ement(var strNamespaceURI: WideString;var strLocalName: WideString;
var strQName: WideString; const oAttributes: IVBSAXAttributes);
begin
end;
procedure TSAXContenthandler.endElem ent(var strNamespaceURI: WideString;var strLocalName: WideString;
var strQName: WideString);
begin
end;
procedure TSAXContentHandler.charact ers(var strChars: WideString);
begin
end;
procedure TSAXContentHandler.ignorab leWhitespa ce(var strChars: WideString);
begin
end;
procedure TSAXContentHandler.process ingInstruc tion(var strTarget: WideString;var strData: WideString);
begin
end;
procedure TSAXContentHandler.skipped Entity(var strName: WideString);
begin
end;
end.
Undeclared Identifier: 'GetTypeInfoCount'
Undeclared Identifier: 'GetTypeInfo'
Undeclared Identifier: 'GetIDsOfNames'
Undeclared Identifier: 'Invoke'
I have had this problem for days and have been searching for a solution. I've tried workarounds or different ways to implement a sax parser to no avail. PLEASE HELP!!!
I'm just trying to implement the IVBSAXContentHandler class. I imported the type library C:\WINDOWS\system32\msxml4
Below is a basic .pas file to try and get things to compile, any help would be greatly appreciated! Thanks!
unit Test;
interface
uses MSXML2_TLB;
type
//========================
// SAX Content Handler
//========================
TSAXContentHandler = class(TInterfacedObject, IVBSAXContentHandler)
public
constructor Create();
procedure Set_documentLocator(const Param1: IVBSAXLocator); safecall;
procedure startDocument; safecall;
procedure endDocument; safecall;
procedure startPrefixMapping(var strPrefix: WideString; var strURI: WideString); safecall;
procedure endPrefixMapping(var strPrefix: WideString); safecall;
procedure startElement(var strNamespaceURI: WideString; var strLocalName: WideString;
var strQName: WideString; const oAttributes: IVBSAXAttributes); safecall;
procedure endElement(var strNamespaceURI: WideString; var strLocalName: WideString;
var strQName: WideString); safecall;
procedure characters(var strChars: WideString); safecall;
procedure ignorableWhitespace(var strChars: WideString); safecall;
procedure processingInstruction(var strTarget: WideString; var strData: WideString); safecall;
procedure skippedEntity(var strName: WideString); safecall;
property documentLocator: IVBSAXLocator write Set_documentLocator;
end;
implementation
//========================
// SAX Content Handler
//========================
constructor TSAXContentHandler.Create(
begin
end;
procedure TSAXContentHandler.Set_doc
begin
end;
procedure TSAXContentHandler.startDo
begin
end;
procedure TSAXContentHandler.endDocu
begin
end;
procedure TSAXContentHandler.startPr
begin
end;
procedure TSAXContentHandler.endPref
begin
end;
procedure TSAXContentHandler.startEl
var strQName: WideString; const oAttributes: IVBSAXAttributes);
begin
end;
procedure TSAXContenthandler.endElem
var strQName: WideString);
begin
end;
procedure TSAXContentHandler.charact
begin
end;
procedure TSAXContentHandler.ignorab
begin
end;
procedure TSAXContentHandler.process
begin
end;
procedure TSAXContentHandler.skipped
begin
end;
end.
ASKER
Yeah, I still don't understand why I'm getting the compiler errors since I'm not using any of those types. if you try to compile this code in Delphi 5, you'll receive those errors. I'm go see if I get the same errors in Delphi 7.
ASKER
FYI - I tried the same code in Delphi 7 and got the same compiler errors.
Check your IVBSAXContentHandler interface.
i think in the interface part you declared these functions(GetTypeInfoCount ,
GetTypeInfo,GetIDsOfNames, Invoke)
{========================= ========== ======}
For Example
IVBSAXContentHandler=inter face
Function IsSelected():Boolean;
end;
then
TSAXContentHandler = class(TInterfacedObject, IVBSAXContentHandler)
public
Function IsSelected():Boolean; //declaration
end;
Function IsSelected():Boolean;
begin
Selected:=true;
end;
{========================= ====}
Sorry for my bad english
i think in the interface part you declared these functions(GetTypeInfoCount
GetTypeInfo,GetIDsOfNames,
{=========================
For Example
IVBSAXContentHandler=inter
Function IsSelected():Boolean;
end;
then
TSAXContentHandler = class(TInterfacedObject, IVBSAXContentHandler)
public
Function IsSelected():Boolean; //declaration
end;
Function IsSelected():Boolean;
begin
Selected:=true;
end;
{=========================
Sorry for my bad english
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mlmcc