Link to home
Start Free TrialLog in
Avatar of acartus
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_documentLocator(const Param1: IVBSAXLocator);
begin
end;

procedure TSAXContentHandler.startDocument();
begin
end;

procedure TSAXContentHandler.endDocument();
begin
end;

procedure TSAXContentHandler.startPrefixMapping(var strPrefix: WideString;var strURI: WideString);
begin
end;

procedure TSAXContentHandler.endPrefixMapping(var strPrefix: WideString);
begin
end;

procedure TSAXContentHandler.startElement(var strNamespaceURI: WideString;var strLocalName: WideString;
                       var strQName: WideString; const oAttributes: IVBSAXAttributes);
begin
end;

procedure TSAXContenthandler.endElement(var strNamespaceURI: WideString;var  strLocalName: WideString;
                     var strQName: WideString);
begin
end;

procedure TSAXContentHandler.characters(var strChars: WideString);
begin
end;

procedure TSAXContentHandler.ignorableWhitespace(var strChars: WideString);
begin
end;

procedure TSAXContentHandler.processingInstruction(var strTarget: WideString;var strData: WideString);
begin
end;

procedure TSAXContentHandler.skippedEntity(var strName: WideString);
begin
end;

end.
Avatar of Mike McCracken
Mike McCracken

I don't see where you use those identifiers.

mlmcc
Avatar of acartus

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.
Avatar of acartus

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=interface
      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
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial