Einzelnen Beitrag anzeigen

Fritzew

Registriert seit: 18. Nov 2015
Ort: Kehl
678 Beiträge
 
Delphi 11 Alexandria
 
#9

AW: Fragen zu Generic TList

  Alt 26. Jan 2017, 10:04
Zitat:
Schau mal in die WARNUNG-Meldungen des Compilers. Da steht's eigentlich
[dcc32 Warnung] fo_Tlist.pas(56): W1010 Methode 'Notify' verbirgt virtuelle Methode vom Basistyp 'System.Generics.Collections.TList<fo_Tlist.TMyCla ss>'

Du erzeugst eine neue Notify Procedure

mach es so:

Delphi-Quellcode:
 TMyList = class(TList<TMyClass>)
  private
    FFreeOnDelete: Boolean;
// Die Notify ist protected
   protected
    procedure Notify(const Ptr: tMyclass; Action: TCollectionNotification); override; // Überschreiben nicht virtual
  public
    constructor Create(bValue: Boolean = true);
  end;
Fritz Westermann

Geändert von Fritzew (26. Jan 2017 um 10:07 Uhr)
  Mit Zitat antworten Zitat