Autor Beitrag
Masterrandy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 13.07.05 14:53 
Hallo,


habe ein Problem in der folgenden Zeile:

if (ClassType <> TGradientForm) and not (csDesigning in ComponentState) then

Ich erhalte immer eine Meldung: Property does not exist. Denke mal es liegt an ClassType <> TGradientForm. Wie könnte man das anders schreiben?

Was mich dabei wundert ist, dass die Klasse in der das aufgerufen wird vom Typ TGradientForm ist. ClassType müsste somit immer der rechten Seite sein oder?

Gruß
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mi 13.07.05 14:54 
Poste doch mal den ganzen Source! :wink: :!:

_________________
Aus dem Urlaub zurück!
Masterrandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 13.07.05 15:42 
Naja, den ganzen Code zu posten wäre etwas zu viel :wink:

Aber hier habe ich das an einem einfachen Bsp versucht (aus der Delphi-Hilfe) .... gleiche Fehlermeldung!

Tritt der nur bei mir auf?


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:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    ListBox1: TListBox;
  private
    procedure Button1Click(Sender: TObject);
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

var
  ClassRef: TClass;
begin
  ListBox1.Clear;
  ClassRef := Sender.ClassType;
  while ClassRef <> nil do
  begin
    ListBox1.Items.Add(ClassRef.ClassName);
    ClassRef := ClassRef.ClassParent;
  end;

end;

end.


Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt.
Masterrandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55



BeitragVerfasst: Mi 13.07.05 16:00 
So, habe jetzt das Update 1 eingespielt. Damit lief zumindest der Test.

Hier noch etwas Code von der Fehlerauslösenden Prozedur:


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:
CreateNew(AOwner {$IFDEF DFS_CPPB_1}, 1 {$ENDIF});
  ClassRef := ClassType;
  if (ClassRef <> TGradientForm) and not (csDesigning in ComponentState) then
  begin
    FCreating := TRUE;
    try
      if not InitInheritedComponent(Self, TGradientForm) then
        {$IFDEF DFS_COMPILER_2}
        raise EResNotFound.CreateResFmt(sResNotFound, [ClassName]);
        {$ELSE}
        raise EResNotFound.CreateFmt(sResNotFound, [ClassName]);
        {$ENDIF}
    finally
      FCreating := FALSE;
    end;

    // All versions of Delphi, and C4 and up.
    {$IFDEF DFS_DELPHI}
      {$DEFINE DFS_DO_ONCREATE}
    {$ENDIF}
    {$IFDEF DFS_CPPB_4_UP}
      {$DEFINE DFS_DO_ONCREATE}
    {$ENDIF}
    {$IFDEF DFS_DO_ONCREATE}
    try
      if {$IFDEF DFS_COMPILER_4_UP} OldCreateOrder and {$ENDIF}
         assigned(OnCreate) then
        OnCreate(Self);
    except
      Application.HandleException(Self);
    end;
    {$UNDEF DFS_DO_ONCREATE}
    {$ENDIF}
  end;
end;


Hier tritt der Fehler noch immer auf :?

Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt.