Einzelnen Beitrag anzeigen

jbg

Registriert seit: 12. Jun 2002
3.481 Beiträge
 
Delphi 10.1 Berlin Professional
 
#5

Re: Delphi Preprocessor und Subprocessor?

  Alt 10. Aug 2003, 17:27
Ich hätte auch besser lesen können.


Für Delphi 3 würde das ungefähr so aussehen:
Delphi-Quellcode:
uses ToolIntf, Exptintf;

type
  TCompilerNotifier = class(TIAddInNotifier)
  public
    procedure FileNotification(NotifyCode: TFileNotification;
      const FileName: string; var Cancel: Boolean); override;
    procedure EventNotification(NotifyCode: TEventNotification;
      var Cancel: Boolean); override;
  end;

procedure TCompilerNotifier.EventNotification(NotifyCode: TEventNotification;
  var Cancel: Boolean);
begin
  if NotifyCode = enBeforeCompile then
  begin
    // ..
  end
  else // if NotifyCode = enAfterCompile then
  begin
    // ...
  end;
end;

var
  CompilerNotifier: TCompilerNotifier;

initialization
  CompilerNotifier := TCompilerNotifier.Create;
  ToolServices.AddNotifierEx(CompilerNotifier);
finalization
  ToolServices.RemoveNotifier(CompilerNotifier);
end.
  Mit Zitat antworten Zitat