Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Indy10 IdTCPServer > OnExecute? (https://www.delphipraxis.net/98329-indy10-idtcpserver-onexecute.html)

napsterxx 25. Aug 2007 02:30


Indy10 IdTCPServer > OnExecute?
 
Also ich wollte das im OnExecute Ereignis, der empfangene String in eine Variable geschrieben wird, und dann überprüft wird ob darauf etwas zu tun ist.
Das Problem ich bekomme im type teil die fehlermeldung. Mit kommentar verdeutlicht.

Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    IdTCPServer1: TIdTCPServer;
    procedure FormCreate(Sender: TObject);
    procedure IdTCPServer1Execute(AContext: TIdContext); //Hier bekomme ich eine Fehlermeldung:
                                                          //[Fehler] Unit1.pas(12): E2003 Undefinierter Bezeichner: 'TIdContext'
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
IdTCPServer1.Defaultport := 12345;
IdTCPServer1.active       := true;
end;

procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var s : String;
begin
s := AThread.connection.readln;

if s = 'hallo' then
Memo1.Lines.Add('Willkommen in meinem kleinen Chat');
Kann mir das jemand erklären?
Ich habe nur auf OnExecute geklickt. Benutze Delphi 2005 und Indy 10.

napsterxx 25. Aug 2007 02:38

Re: Indy10 IdTCPServer > OnExecute?
 
Sry für meine blöde Frage. Erst nichts gefunden, und dann Fehlermeldung komplett bei google eingegeben und tata es geht^^

Zacherl 25. Aug 2007 14:11

Re: Indy10 IdTCPServer > OnExecute?
 
Für alle anderen: Einfach die Unit IdContext zur USES Klausel hinzufügen :???:


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz