Einzelnen Beitrag anzeigen

r29d43

Registriert seit: 18. Jan 2007
287 Beiträge
 
Delphi 10.4 Sydney
 
#8

AW: IOTA-Frage zur Callbarkeit von Procs unterschiedlicher Notifier untereinander

  Alt 26. Mai 2021, 08:22
Aber erzeugst du die Notifier nicht auch dynamisch?

Besten Dank für den Tipp, hat funktioniert.

Ich habe das obige Beispiel jetzt in der Register-Proc dementsprechend umgebaut, so dass ich nun faktisch die gleichen Bedingungen habe, wie in einem normalen Delphi-Prog bzgl. der dort jeweils deklarierten Formularen:

Delphi-Quellcode:
unit readEditorCode_Unit;

interface

uses ToolsAPI, Winapi.Windows, Winapi.Messages, Registry, vcl.ExtCtrls, vcl.Controls, system.Rtti,

TIDENotifier = class(TNotifierObject, IOTANotifier, IOTAIDENotifier)
    Timer1 : TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    ...
  public
    // IOTAIDENotifier
    VarXYZ : integer; // <--------
    procedure FileNotification(NotifyCode: TOTAFileNotification; const FileName: string; var Cancel: Boolean);
    procedure BeforeCompile(const Project: IOTAProject; var Cancel: Boolean); overload;
    procedure AfterCompile(Succeeded: Boolean); overload;
    constructor Create;
    destructor Destroy; override;
    procedure ProcABC; // <--------
  end; { of "TIDENotifier = class() }

var
  IDENotifier1 : TIDENotifier;
  NotifierIndex: Integer = -1;

procedure Register;

implementation

uses vcl.Dialogs, system.SysUtils, shellapi, EditServiceNotifer;

procedure Register;
var
  Services: IOTAServices;
begin
  if not Supports(BorlandIDEServices, IOTAServices, Services) then Exit;
  IDENotifier1 := TIDENotifier.Create;
  NotifierIndex := Services.AddNotifier(IDENotifier1);
end;

usw. usf..
  Mit Zitat antworten Zitat