Autor Beitrag
Mike_C
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Sa 12.02.05 12:51 
Hi

so ein ähnliches Thema gab es schonmal, allerdings trifft das nicht genau mein Problem:
ich möchte eine Klasse von TForm ableiten, um damit so zu sagen einen "virtuellen" Dialog realisieren zu können, den man bei Bedarf codegesteuert personalisieren kann.

Nun, meine Klasse sieht so aus

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
TVirtualDlg = class (TForm)
  private
     mDlgProperties: TDialogProperties;

     function getDlgProperties ():TDialogProperties;
     procedure InitVirtualDialog ();
     procedure UpdateProperties ();

  public
     constructor Create(); virtual;
     destructor Destroy; override;

     procedure setID(mID: integer);
     procedure setCaption(mCaption: string);


     property DialogProperties: TDialogProperties read getDlgProperties;
  end;

nur nebenbei: was die TDialogProperties machen sollen ist folgendes: eine einfache Möglichketi schnell an die Basiseinstellungen des DIalogs ranzukommen.

das eigentliche Problem, wenn ich jetzt eine Instanz von dieser Klasse erstellen will (VirtualDlg.Create) bekomme ich den Fehler: "Resource TVirtualDlg nicht gefunden"
weiß jemand woran das liegt?

Gruß Mike

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
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: Sa 12.02.05 12:55 
Ich empfehle dir, Create auch zu "overriden". Wie erstellst du die Form? TVirtual.Create oder Application.CreateForm?

AXMD
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Sa 12.02.05 13:37 
ok, das mit dem overriden: tja ich hatte es vergessen...
erstellen tu ich das ganze mit TVirtualDlg.Create(). Kann es daran liegen, dass kein DFM-File zur Verfügung steht? wenn ja geht das ganze auch ohne?

Gruß Mike

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
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: Sa 12.02.05 13:41 
Verusch mal Application.CreateForm - das sollte gehen.

AXMD
Mike_C Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 207

Win XP
D7 Enterprise
BeitragVerfasst: Sa 12.02.05 13:43 
hab ich versucht
ausblenden Delphi-Quelltext
1:
application.CreateForm (TVirtualDlg, vDlg);					

der Fehler bleibt trotzdem...

_________________
Life is, what some people call a mystery. To me life's just a lesson, you're learning when you're through. So why do we try to understand?
Wizard of OS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

Win95, Win98, Win2000, WinNT, Win XP
D5
BeitragVerfasst: Mo 21.02.05 19:35 
Jedes Formular hat auch eine zugehörige res-Datei,
das will wohl die Fehlermeldung sagen.

Aber Application.CreateForm sollte eigentlich gehen ... :roll:

Warum machst Du eigentlich den Konstruktor virtuell?

Denke dass es darin liegen könnte ...