Thema: Delphi Umgang mit Interfaces

Einzelnen Beitrag anzeigen

Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#22

AW: Umgang mit Interfaces

  Alt 12. Dez 2013, 07:22
Oder sogar doppelt ... falls die Basis-Instanz als Klasse benötigt wird
Delphi-Quellcode:
TListData = class
private
  fAsIntf : IInterface;
  fAsObj: TMyClasses;
  fName: String;
  fHash: Cardinal;
public
  property AsIntf : IInterface read fAsIntf;
  property AsObj : TMyClasses;
  property Name : string read fName;
  property Hash : Cardinal read fHash;
End;
Und beim Destroy von TListData einfach mal nicht die Objekt-Instanz befreien
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat