Book a Demo

Author Topic: Delphi code generation and tInterfacedObject  (Read 3236 times)

Piotr Rezmer

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Delphi code generation and tInterfacedObject
« on: March 19, 2010, 10:20:30 pm »
Hello,

I created a Delphi class that implements an interface. When I generate the code for it, I receive:

CFailOverManager = class (TInterfacedObject, IFailOverInterface)
  private
    ....
  protected
    function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
    function _AddRef: Integer; stdcall;
    function _Release: Integer; stdcall;
  public
    ...
    function send(Var event: CTIEvent; extension: string): boolean;
    destructor Destroy; override;
    constructor Create; overload;
  end;

However I don't want to  _AddRef(), _Release() methods since the class inherits from tInterfacedObject. How can I stop EA from producing such methods?
best regards
Piotr Rezmer

jkorman

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Delphi code generation and tInterfacedObject
« Reply #1 on: March 20, 2010, 12:24:19 am »
Looks like that is getting "built" in the Class Body part of the Delphi Code Template. At first guess I'd say you'd need to add a further check at this point to check for TInterfacedObject and not add the additional code if present.

Jim