Einzelnen Beitrag anzeigen

Christian Seehase
(Co-Admin)

Registriert seit: 29. Mai 2002
Ort: Hamburg
11.105 Beiträge
 
Delphi 11 Alexandria
 
#7
  Alt 1. Mär 2003, 13:16
Moin Armin,

hier mal zwei Möglichkeiten:
Beide setzen allerdings voraus, dass sich die Kompo nicht auf einem der Formulare befindet.

Delphi-Quellcode:
// Variante 1

PROGRAM Compo_test;

uses
  Forms,
  FlappError, // Meine Komponente
  uMain in 'uMain.pas{Form1},
  Unit2 in 'Unit2.pas{Form2},
  Flapp_Utils in 'Flapp_Utils.pas';
{$R *.res} 

var
  leWork : TFlappError;

BEGIN
  Application.Initialize;
  
  leWork := TFlappError.Create;
  try
    Application.CreateForm(TForm1, Form1);
    Application.CreateForm(TForm2, Form2);
    Application.Run;
  finally
    FreeAndNil(leWork);
  end;
END.


// Variante 2

Unit Unit1;

interface

//...


var
  leWork : TFlappError;

//...

implementation

//...

initialization
begin
  leWork := TFlappError.Create;
end;

finalization
begin
  FreeAndNil(leWork);
end;
Tschüss Chris
Die drei Feinde des Programmierers: Sonne, Frischluft und dieses unerträgliche Gebrüll der Vögel.
Der Klügere gibt solange nach bis er der Dumme ist
  Mit Zitat antworten Zitat