Einzelnen Beitrag anzeigen

tomkupitz

Registriert seit: 26. Jan 2011
323 Beiträge
 
Delphi 11 Alexandria
 
#1

Komponenten-Fehler

  Alt 6. Feb 2019, 12:29
Hallo,

ich habe folgende Komp.:

Code:
unit DemoManager;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TDemoManager = class(TComponent)
  private
    FStrings: TStrings;

    procedure SetStrings(Value: TStrings);
  protected

  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;

  published
    property Strings: TStrings read FStrings write SetStrings stored False;
  end;

implementation

constructor TDemoManager.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);

  FStrings:=TStringList.Create;
end;

destructor TDemoManager.Destroy;
var i: Integer;

begin
  for i:=0 to FStrings.Count-1 do
    if FStrings.Objects[i]<>nil then
      FStrings.Objects[i].Free;

  FStrings.Free;

  inherited Destroy;
end;

procedure TDemoManager.SetStrings(Value: TStrings);
begin
  if csDesigning in ComponentState then
    FStrings.Assign(Value);
end;

end.
und

Code:
unit DesignDemoManager;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  DesignIntf, DesignEditors,
  DemoManager;

type
  TDemoEditor = class(TPropertyEditor)
  public
    FStrings: TStrings;
   
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
    function GetValue: string; override;
    function GetName: string; override;
  end;

procedure Register;

implementation

procedure TDemoEditor.Edit;
begin
  ShowMessage('OK');
end;

function TDemoEditor.GetAttributes: TPropertyAttributes;
begin
  result := [paDialog, paReadOnly];
end;

function TDemoEditor.GetValue: string;
begin
  result := '[DemoEditor]';
end;

function TDemoEditor.GetName: string;
begin
  result := 'Editor';
end;

//

procedure Register;
begin
  RegisterComponents('New', [TDemoManager]);
  RegisterPropertyEditor(TypeInfo(TStrings), TDemoManager, 'Strings', TDemoEditor);
end;

end.
Diese Komp. habe ich so installiert: siehe Abb. 2.jpg

Das Installieren funktioniert noch. Wenn ich aber DesignComponents.bpl erzeuge erhalte ich die Meldung: siehe Abb. 1.jpg

Woran liegt das und was kann/muss ich tun?

Danke und beste Grüße
Miniaturansicht angehängter Grafiken
2.jpg   1.jpg  
  Mit Zitat antworten Zitat