Autor Beitrag
Bastian25
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 18:22 
Hallo,


ich habe eine neue Komponente "entwickelt" in der sowas wie ein Newsticker/Laufschrift entsteht!
Leider ist ein Fehler beim Start dieser Komponente enstanden, nachdem ich sie auf dem Formular plaziert habe und das Project gestartet habe!

Der Fehler lautet:
Im Projekt Project1.exe ist eine Exception der Klasse EClassNotFound aufgetreten!

Weiß jemand, wo der Fehler liegt?

Gruß Bastian

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
unit LString;

interface

uses
  SysUtils, Classes, Controls, StdCtrls, Extctrls;

type
  TLString = class(TLabel)
  private
    { Private-Deklarationen }
    fTimer: TTimer;
    fEin: Boolean;
    fNeustart: Boolean;
    fLSchrift_1: String;
    fLSchrift_2: String;
    procedure SetEin(const Value: Boolean);
    procedure SetLSchrift_1(const Value: String);
    procedure fTimerTimer (Sender: TObject);
    procedure SetNeustart(const Value: Boolean);
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
    constructor Create(aOwner: TComponent); override;
    destructor Destroy(); override;

  published
    { Published-Deklarationen }
    property Ein: Boolean read fEin write SetEin;
    property Laufschrift: String read fLSchrift_1 write SetLSchrift_1;
    property Neustart: Boolean read fNeustart write SetNeustart;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Eigene', [TLString]);
end;

constructor TLString.Create(aOwner: TComponent);
begin

  inherited Create(aOwner);
  fTimer:= TTimer.Create(aOwner);
  fTimer.Interval := 100;
  fTimer.Enabled := false;
  fTimer.OnTimer := fTimerTimer;
  Caption:='';
end;


destructor TLString.Destroy;
begin

  inherited Destroy;
  fTimer.Destroy;
  fTimer.Free;
end;


procedure TLString.SetEin(const Value: Boolean);
begin

  fEin := Value;
  fTimer.Enabled := True;
end;

procedure TLString.SetLSchrift_1(const Value: String);
begin

  if not fEin then

    begin
      fLSchrift_1 := Value;
    end
    else

      begin
        fLSchrift_2 := Value;
      end;
end;


procedure TLString.SetNeustart(const Value: Boolean);
begin
  fNeustart := True;
end;


procedure TLString.fTimerTimer(Sender: TObject);
var
  memo: Char;
begin
  if fNeustart then
  begin
  fLSchrift_1 := fLSchrift_2;
  fNeustart := false;
  end;

  if fEin then
  begin
    Caption := fLSchrift_1;
    memo := fLSchrift_1[1];
    delete(fLSchrift_1,1,1);
    fLSchrift_1 := fLSchrift_1 + memo;
  end;
end;




end.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 24.01.05 18:29 
Andere Frage: sollte "inherited destroy" nicht erst nach dem Freigeben aufgerufen werden?

AXMD
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 18:32 
AXMD hat folgendes geschrieben:
Andere Frage: sollte "inherited destroy" nicht erst nach dem Freigeben aufgerufen werden?

AXMD


Das ist ne gute Frage!?!?!?!
Wäre es denn besser das Destroy nach dem Freisetzen zu plazieren?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 24.01.05 18:39 
Vielleicht sollte ich nächstes mal nicht so sarkastisch schreiben, dass du verstehst, dass es unklug ist, vorher die Komponente und danach seine Variablen zu zerstören ;)

AXMD
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 18:44 
Hehe, ich habe mir ja schon sowas gedacht! :D
Hmm...habe das jetzt mal umgeändert aber irgendwie ist der fimmer noch da!
:?: :?: :?: :?: :?: :?:
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 24.01.05 18:46 
Schon mal debuggt?

AXMD
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Mo 24.01.05 19:00 
Ein guter Tipp, schau die mal vom Projekt JEDI die JVCL Komponenten an, da sind schon gut funktionierende Laufschriftkomponenten drin.

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 19:13 
Hansi@OMG hat folgendes geschrieben:
Ein guter Tipp, schau die mal vom Projekt JEDI die JVCL Komponenten an, da sind schon gut funktionierende Laufschriftkomponenten drin.


wo kann ich die denn genau finden?
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 19:14 
AXMD hat folgendes geschrieben:
Schon mal debuggt?

AXMD


Jupp, habe es debugget, aber es erscheint keine fehlermeldung!
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Mo 24.01.05 19:16 
Die JVCL findest du unter www.dsdt.info/jedi/

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mo 24.01.05 19:21 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  if fEin then  
  begin  
    Caption := fLSchrift_1;   //ad 1.
    memo := fLSchrift_1[1];   //ad 2.
    delete(fLSchrift_1,1,1);  
    fLSchrift_1 := fLSchrift_1 + memo;  
  end;


1.) fLSchrift_1 ist nicht initialisert, also wahrscheinlih leer.

2.) Müsste eine Access Violation augrund von 1.) verursachen

AXMD
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 19:22 
Hansi@OMG hat folgendes geschrieben:
Die JVCL findest du unter www.dsdt.info/jedi/

Besten Dank für den Link, mal gucken ob ich das für die Hausarbeit benutzen kann!!!!
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 19:24 
AXMD hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  if fEin then  
  begin  
    Caption := fLSchrift_1;   //ad 1.
    memo := fLSchrift_1[1];   //ad 2.
    delete(fLSchrift_1,1,1);  
    fLSchrift_1 := fLSchrift_1 + memo;  
  end;


1.) fLSchrift_1 ist nicht initialisert, also wahrscheinlih leer.

2.) Müsste eine Access Violation augrund von 1.) verursachen

AXMD



ok, ich werde das mal versuchen! Danke!
Hätte mir der debugger dann nicht auch ne medlung geben müssen???
hmm...
Bastian25 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP
D7 Pers
BeitragVerfasst: Mo 24.01.05 19:38 
funktioniert irgendwie auch nicht! kommen jetzt haufenweise zugriffsverletzungen und delphi stürzt ab!
denke mal das liegt irgendwie am TTimer....!?
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Mo 24.01.05 20:19 
Ein Formular, nix drauf... und funzt
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,LString, StdCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  a:TLString;
begin
  a:=TLString.Create(nil);
  a.Ein:=true;
end;

end.


ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
unit LString;

interface

uses
  SysUtils, Classes, Controls, StdCtrls, Extctrls;

type
  TLString = class(TLabel)
  private
    { Private-Deklarationen }
    fTimer: TTimer;
    fEin: Boolean;
    fNeustart: Boolean;
    fLSchrift_1: String;
    fLSchrift_2: String;
    procedure SetEin(const Value: Boolean);
    procedure SetLSchrift_1(const Value: String);
    procedure fTimerTimer (Sender: TObject);
    procedure SetNeustart(const Value: Boolean);
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
    constructor Create(aOwner: TComponent); override;
    destructor Destroy(); override;

  published
    { Published-Deklarationen }
    property Ein: Boolean read fEin write SetEin;
    property Laufschrift: String read fLSchrift_1 write SetLSchrift_1;
    property Neustart: Boolean read fNeustart write SetNeustart;
  end;

implementation

uses Unit1;

procedure Register;
begin
  RegisterComponents('Eigene', [TLString]);
end;

constructor TLString.Create(aOwner: TComponent);
begin

  inherited Create(aOwner);
  fTimer:= TTimer.Create(aOwner);
  fTimer.Interval := 100;
  fTimer.Enabled := false;
  fTimer.OnTimer := fTimerTimer;
  Caption:='';
  fLSchrift_1:='hallo du';
end;


destructor TLString.Destroy;
begin

  inherited Destroy;
  fTimer.Destroy;
  fTimer.Free;
end;


procedure TLString.SetEin(const Value: Boolean);
begin

  fEin := Value;
  fTimer.Enabled := True;
end;

procedure TLString.SetLSchrift_1(const Value: String);
begin

  if not fEin then

    begin
      fLSchrift_1 := Value;
    end
    else

      begin
        fLSchrift_2 := Value;
      end;
end;


procedure TLString.SetNeustart(const Value: Boolean);
begin
  fNeustart := True;
end;


procedure TLString.fTimerTimer(Sender: TObject);

var
  memo: Char;
begin
  if fNeustart then
  begin
  fLSchrift_1 := fLSchrift_2;
  fNeustart := false;
  end;

  if fEin then
  begin
    Caption := fLSchrift_1;
    memo := fLSchrift_1[1];
    delete(fLSchrift_1,1,1);
    fLSchrift_1 := fLSchrift_1 + memo;
    Form1.Label1.Caption:=fLSchrift_1;
  end;
end;
end.