Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

TWinControl via TInterfacedObject via TInterfacedPersistent

  Alt 3. Jun 2018, 22:20
Meine Classe

Aktuell..
Delphi-Quellcode:
TOnSessionStateEvent = procedure(Sender: TCustomAudioVolume; NewState: integer) of object;

TCustomAudioVolume = class(TWinControl)
  //
end;

TAudioVolume = class(TCustomAudioVolume, IAudioSessionEvents, IMMNotificationClient,
  IAudioSessionNotification, IAudioEndpointVolumeCallback)
begin
// .. Inhalt jetzt egal
end
Ich verwende keine WinControls daher frage ich mich was besser wäre das Aktuelle oder diese hier.

TInterfacedObject..
Delphi-Quellcode:
TOnSessionStateEvent = procedure(Sender: TObject; NewState: integer) of object;

TAudioVolume = class(TInterfacedObject, IAudioSessionEvents, IMMNotificationClient,
  IAudioSessionNotification, IAudioEndpointVolumeCallback)
TInterfacedPersistent..
Delphi-Quellcode:
TOnSessionStateEvent = procedure(Sender: TPersistent; NewState: integer) of object;

TAudioVolume = class(TInterfacedPersistent, IAudioSessionEvents, IMMNotificationClient,
  IAudioSessionNotification, IAudioEndpointVolumeCallback)
welche vor bzw.. Nachteile würden sich dadurch ergeben?
wie sieht das dann mit create, inherited und Konsorte aus.

Ja bei TObject, TPersistent müsste ich Create ändern nur welche gesamt Auswirkung hätten diese Änderungen und sind sie sinnvoll.

Delphi-Quellcode:
public
  constructor Create; reintroduce;
Delphi-Quellcode:
constructor TAudioVolume.Create();
inherited Create();

gruss

Geändert von EWeiss ( 3. Jun 2018 um 22:35 Uhr)
  Mit Zitat antworten Zitat