Autor Beitrag
horsti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mo 14.11.05 23:45 
Hi,
wenn ich versuche ein Formular einer aus der selben Unit zu öffnen, dann kommt o.g. Exeption.

Aufruf ist wie folgt:

dummy := frmTest.showModal;

dummy ist vom Typ integer

oder

frmTest.show;

beides ergibt diese Exeption, bin ich denn doof?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 15.11.05 00:11 
Ist frmTest initialisiert?

Poste mal etwas mehr Source ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
horsti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Di 15.11.05 00:48 
ausblenden 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:
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, Grids, uTest;

[...]


var
  frm_main: Tfrm_main;

implementation


{$R *.dfm}


procedure Tfrm_main.hinzufuegenClick(Sender: TObject);
var
  j : Integer;
begin
  j := frmTest.ShowModal;
end;

end.



und hier die uTest:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
[...]

var
  frmTest: TfrmTest;

implementation

{$R *.dfm}

end.


Habs nochmal etwas verändert, also verusche jetzt direkt aus dem Hauptprogramm das andere Formular aufzurufen. Kompilieren geht 1A, aber beim Ausführen und Klick auf einen Menübutton kommt wieder die Execption.
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: Di 15.11.05 01:21 
Hast Du frmTest erzeugt?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure Tfrm_main.hinzufuegenClick(Sender: TObject);
var
  j : Integer;
  frmTest: TfrmTest;
begin
  frmTest := TfrmTest.Create(Application);
  try
    try
      j := frmTest.ShowModal;
    except
      raise;
    end;
  finally
    FreeAndNil(frmTest);
  end;
end;
horsti Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Di 15.11.05 14:01 
Danke, das wars.

Aber normalweise steht sowas noch immer in der Projektdatei?!
Wieso wurde das denn nicht auto. hinzugefügt?