![]() |
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:
Kann mir das jemand erklären?
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'); Ich habe nur auf OnExecute geklickt. Benutze Delphi 2005 und Indy 10. |
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^^
|
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 01:02 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz