Autor Beitrag
No0B
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 28.03.10 14:55 
Guten zusammen, habe mir ein kleines Programm geschrieben, jetzt will ich durch ein Knopfdruck im Project1 (name des Projekt) ein neues Fenster öffnen.

Die datei dazu heisst Porjectinfo und liegt im selben Ordner wie wie Project1.

Habe es mit projectinfo.show; versucht aber funzt net, Warum?

hier mal der Quelltext von Project1:
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:
unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, jpeg, ExtCtrls, MMSystem, MPlayer, Buttons ;

type
  TForm1 = class(TForm)
    Button2: TButton;
    Image1: TImage;
    MediaPlayer1: TMediaPlayer;
    SpeedButton1: TSpeedButton;
    procedure Button2Click(Sender: TObject);
    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
      var DoDefault: Boolean);
    procedure MediaPlayer1Play(Sender: TObject);
    procedure Value(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
begin
application.Terminate
end;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
   ReleaseCapture;
   Perform(WM_SYSCOMMAND, $F0120);
end;

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  Perform(WM_SYSCOMMAND, $F0120);

     { Fenster verschieben }
end;

procedure TForm1.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
  var DoDefault: Boolean);
begin
MediaPlayer1.Open;
MediaPlayer1.Play;
end;

procedure TForm1.MediaPlayer1Play(Sender: TObject);
begin
MediaPlayer1.Play;
end;


procedure TForm1.SpeedButton1Click(Sender: TObject);
begin


end;

procedure TForm1.Value(Sender: TObject);
begin
 if MediaPlayer1.NotifyValue = nvSuccessful then
   MediaPlayer1.Play;
end;

end.


Moderiert von user profile iconKha: B- durch Delphi-Tags ersetzt
Moderiert von user profile iconNarses: Topic aus Multimedia / Grafik verschoben am So 28.03.2010 um 23:55
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 28.03.10 15:00 
user profile iconNo0B hat folgendes geschrieben Zum zitierten Posting springen:
Habe es mit projectinfo.show; versucht aber funzt net, Warum?
Vermutlich weil du die Datei noch nicht dem Projekt hinzugefügt hast, zudem sehe ich die Datei auch nicht in der uses.

Eine Fehlermeldung hast du ja leider vergessen zu posten...
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 28.03.10 15:06 
Was meinst du mit "dem Projekt hinzugefügt"? Habe es Jetzt in die uses übernommen, aber er unterstreicht mir immer noch
Project.info
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 28.03.10 15:09 
Was macht der Punkt da? Das funktioniert nicht.

Wenn die Unit gar nicht im Projekt ist, dann kennt das Projekt die auch nicht. Projekt --> Hinzufügen, fertig. Oder manuell in die Projektdatei schreiben (Projekt --> Quelltext anzeigen).
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 28.03.10 15:12 
Sorry mein Fehler, Projectinfo.show; natürlich. Werds mal versuchen.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 28.03.10 15:17 
Unterstreichen ist ohnehin unwichtig, interessant sind nur die Fehlermeldungen beim Kompilieren. ;-)
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 28.03.10 15:21 
Ok habs mal hinzugefügt, Projekt--> hinzufügen. Beim Compilieren kommt der Fehler [DCC Fehler] info.dpr(12): E2003 Undeklarierter Bezeichner: 'Form1'

Hier auch noch mal der Quelltext von Projectinfo. muss ich darin auch noch was verändern ?
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:
25:
26:
27:
28:
29:
30:
unit info;

interface

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

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

var
  Form2: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

end.


Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 28.03.10 15:32 
Nun ja, du hast bereits ein Formular des Typs TForm1... Und in dieser Datei nochmal. Wie soll das klappen?

Erstell doch einfach über das Menü Datei --> Neu --> Formular ein neues Formular, das ist dann auch schon in deinem Projekt und gut ists.

Und wenn du dann noch deine Formulare und Komponenten ordentlich benennst, dann hast du auch keine Probleme mehr. :roll:
Kinder nennt man ja auch nicht Kind1, Kind2 usw., sondern gibt ihnen Namen, oder willst du gerne Kind1 oder so statt deinem Namen heißen?
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 28.03.10 15:40 
Alles klar es geht, habe immer eine neue Formularanwendung erstellt. Ist halt schon ein bisschen her das ich mit Delphi gearbeitet habe.

Danke