Autor Beitrag
Knotti2012
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Di 04.05.04 14:58 
Hallo Leute,

ich habe ein Problem mit der procedure TForm1.FormCreate(Sender: TObject); genauer gesagt weiß ich nicht genau wo ich sie einbinden kann. Er nimmt sie nicht bei uses und dann als Befehl auch nicht.

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:
uses
  Classes, QControls, QStdCtrls, QExtCtrls, QButtons, QForms, Sockets,
  QMenus, QTypes, QGraphics, ShellAPI, ComObj, QComCtrls;


type
  TForm1 = class(TForm)
    memRecv: TMemo;
    Panel1: TPanel;
    memSend: TMemo;
    Panel2: TPanel;
    btnSend: TButton;
    Panel3: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    edtRemotePort: TEdit;
    Label3: TLabel;
    edtLocalPort: TEdit;
    btnActivateServer: TButton;
    TcpClient1: TTcpClient;
    TcpServer1: TTcpServer;
    Image1: TImage;
    edtRemoteHost: TComboBox;
    MainMenu1: TMainMenu;
    Datei1: TMenuItem;
    Ende1: TMenuItem;
    Windows: TMenuItem;
    Systrayminimiren1: TMenuItem;
    N1: TMenuItem;
    Shutdown1: TMenuItem;
    Hilfe1: TMenuItem;
    ber2: TMenuItem;
    ber1: TMenuItem;
    Windows1: TMenuItem;
    ber3: TMenuItem;
    Label4: TLabel;
    procedure btnSendClick(Sender: TObject);
    procedure TcpServer1Accept(sender: TObject;
      ClientSocket: TCustomIpClient);
    procedure btnActivateServerClick(Sender: TObject);
    procedure Ende1Click(Sender: TObject);
    procedure ber3Click(Sender: TObject);
    procedure Shutdown1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  // you must create your own thread to synch
  // writing to a gui component
  TClientDataThread = class(TThread)
  private
  public
    ListBuffer :TStringList;
    TargetList :TStrings;
    procedure synchAddDataToControl;
    constructor Create(CreateSuspended: Boolean);
    procedure Execute; override;
    procedure Terminate;
  end;

var
  Form1: TForm1;
  //DataThread: TClientDataThread;

implementation

uses aboutb;
{$R *.xfm}
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Di 04.05.04 15:16 
Wie so willst Du eigentlich TForm1.FormCreate(Sender: TObject) irgendwo einbinden?
Das Macht delphi doch automatisch mit Druck auf F9.
Knotti2012 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Di 04.05.04 15:19 
auf f9 start bei mir das programm in delphi .. weil ich einen code einbinden will der eine text datei auslesen soll
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 04.05.04 18:51 
Klick doch bitte mal doppelt auf einen leeren Teil deiner Form drauf, und voilà: Du bist im Quellcode-Editor, und das auch noch in der Prozedur "FormCreate" - identisch mit dem "OnCreate"-Ereignis. :shock:

Was willst du denn noch?
Knotti2012 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Do 06.05.04 13:36 
Also ich bin ja schon nen Anfänger :oops: ,

aber so blöd bin ich auch nicht. Das habe ich nämlich schon probiert und schon springt er zu irgenteiner Prozedur ...
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Do 06.05.04 14:24 
Titel: hmm,
hats du die procedure vielleicht gelöcht ? Sie steht normalerweise in der Type Definition , also oberhalb der private Declarationen. Da sie bei dir nicht vorhanden ist hast du kein Procedure FormCreate. Delphi hat IMHO so die Macke wenn er was nichtmehr findet irgendwo hin zu springen.

_________________
mfg. Joel
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 06.05.04 14:27 
Knotti2012 hat folgendes geschrieben:
aber so blöd bin ich auch nicht.

Entschuldige, aber offensichtlich doch ...

Zitat:
Das habe ich nämlich schon probiert und schon springt er zu irgenteiner Prozedur ...

Die Prozedur, zu der er springt, ist nämlich deine "OnCreate"-Prozedur. Wenn sie nicht existiert, dann wird sie von Delphi angelegt. Das heißt im Klartext: Wenn du hier Codeschnippsel findest, die bspw. so aussehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.FormCreate(Sender: TObject);
begin
  //
  // ganz viele komplizierte Codezeilen
  //

  ...

  //
  // hier enden sie
  //
end;

dann nimmst du nur den Teil zwischen begin und end und fügst das lieber in deine eigene "OnCreate"-Prozedur ein als die komplette Prozedur zu kopieren. So hast du nämlich die wenigsten Sorgen.

Ich weiß wirklich nicht was du noch willst.