AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Delphi Preprocessor und Subprocessor?
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi Preprocessor und Subprocessor?

Ein Thema von Assarbad · begonnen am 10. Aug 2003 · letzter Beitrag vom 26. Mär 2010
Antwort Antwort
jbg

Registriert seit: 12. Jun 2002
3.483 Beiträge
 
Delphi 10.1 Berlin Professional
 
#1

Re: Delphi Preprocessor und Subprocessor?

  Alt 10. Aug 2003, 15:06
Das lässt sich doch recht schnell zusammen schreiben, vorausgesetzt man kennt sich mit der OpenTools API aus.

Delphi-Quellcode:
unit PrePostProcessor;
interface
uses
  SysUtils, ToolsAPI;
type
  TCompilerNotifier = class(TNotifierObject, IOTAIDENotifier)
  public
   // IOTAIDENotifier
    procedure FileNotification(NotifyCode: TOTAFileNotification; const FileName: string;
      var Cancel: Boolean); virtual;
    procedure BeforeCompile(const Project: IOTAProject;
      var Cancel: Boolean); overload; virtual;
    procedure AfterCompile(Succeeded: Boolean); overload; virtual;
   // IOTAIDENotifier50
    procedure BeforeCompile(const Project: IOTAProject; IsCodeInsight: Boolean;
      var Cancel: Boolean); overload; virtual;
    procedure AfterCompile(Succeeded: Boolean; IsCodeInsight: Boolean); overload; virtual;
  end;

implementation
{ TCompilerNotifier }

{ veraltete Methoden }
procedure TCompilerNotifier.BeforeCompile(const Project: IOTAProject; var Cancel: Boolean);
begin
end;

procedure TCompilerNotifier.AfterCompile(Succeeded: Boolean);
begin
end;

{ neue Methoden }
procedure TCompilerNotifier.BeforeCompile(const Project: IOTAProject; IsCodeInsight: Boolean; var Cancel: Boolean);
begin
  if SameText(ExtractFileExt(Project.FileName), '.bpg') then Exit; // This should never happen
  if IsCodeInsight then Exit;

// Project.FileName gibt den Dateinamen des Projekts an (.dpr).

{ // save all
  Cancel := not (BorlandIDEServices as IOTAModuleServices).SaveAll;
  if Cancel then Exit; }


end;

procedure TCompilerNotifier.AfterCompile(Succeeded: Boolean; IsCodeInsight: Boolean);
begin
  if not IsCodeInsight then
  
end;

procedure TCompilerNotifier.FileNotification(NotifyCode: TOTAFileNotification;
  const FileName: string; var Cancel: Boolean);
begin
  Cancel := False;
end;


var
  NotifierIndex: Integer;

{ CompilerNotifier registrieren }
initialization
  NotifierIndex := (BorlandIDEServices as IOTAServices).AddNotifier(TCompilerNotifier.Create);

finalization
  if NotifierIndex >= 0 then
    (BorlandIDEServices as IOTAServices).RemoveNotifier(NotifierIndex);

 // clear all IOTACustomMessages here, else Delphi unloads the dll and then
 // it wants to free the messages -> AccessViolation
  (BorlandIDEServices as IOTAMessageServices).ClearToolMessages;

end.
Das ganze musst du jetzt nur noch in ein DesignTime only Package verpacken, dass designide und rtl requires.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:32 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz