Einzelnen Beitrag anzeigen

mcinternet

Registriert seit: 22. Apr 2010
Ort: Odenwald
193 Beiträge
 
Delphi 10.3 Rio
 
#3

AW: bei eigener Komponente die Versionsnummer in der IDE?

  Alt 27. Mär 2019, 17:04
Hier mal ein paar Sourcen,



Zuerst das dpk:
Code:
package owncomponents;

{$R *.res}
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION OFF}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES ON}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DEFINE DEBUG}
{$ENDIF IMPLICITBUILDING}
{$IMPLICITBUILD ON}

requires
  rtl,
  dbrtl,
  dac260,
  mydac260,
  vcl;

contains
  dllquery in 'dllquery.pas',
  dllConnect in 'dllConnect.pas',
  dllDatasource in 'dllDatasource.pas',
  Eigene in 'Eigene.pas',
  AboutOwn in 'AboutOwn.pas';

end.

Dann die Registerunit

Code:
unit Eigene;

interface

  uses dllConnect, dllDataSource, dllQuery;


procedure Register;

implementation

uses System.Classes;



procedure Register;
begin
  RegisterComponents('Own Components', [TdllConnection]);
  RegisterComponents('Own Components', [TdllQuery]);
  RegisterComponents('Own Components', [TdllDataSource]);
end;



end.
Hier eine Komponente:

Code:
unit dllquery;

interface

uses
  System.SysUtils, System.Classes, Data.DB, MemDS, DBAccess, MyAccess, AboutOwn;

type
  TdllQuery = class(TMyQuery)
  private
    { Private-Deklarationen }
    fActiveOnStart : Boolean;
    fAbout: String;
    procedure init;
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
    constructor create(AOwner : TComponent);
    Destructor destroy;
  published
    { Published-Deklarationen }
    property About: String read FAbout write FAbout stored False;
    property ActiveOnStart : Boolean read fActiveOnStart write fActiveOnStart;
  end;

implementation

{ TdllQuery }

procedure TdllQuery.init;
begin
   FAbout := 'Version 1.0';

end;

constructor TdllQuery.create(AOwner : TComponent);
begin
  //
  inherited create(AOwner);

  if fActiveOnStart then active := true
    else active := false;

  init;
end;

Destructor TdllQuery.destroy;
begin
  inherited destroy;
end;


end.
Gruss

mcinternet
Jörg

Geändert von mcinternet (27. Mär 2019 um 17:07 Uhr)
  Mit Zitat antworten Zitat