Autor Beitrag
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 03.01.06 11:21 
Verwende mal bitte den folgenden Code und poste anschl. was Du in der Memo-Box stehen hast.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.DosCommand1NewLine(Sender: TObject; NewLine: String; OutputType: TOutputType);
begin
  Memo1.Lines.Add (NewLine + '  (#' + IntToStr (Pos ('bestmove', NewLine)) + ')');
end;

_________________
Ein Nutzer der Ecke ;-)
Lago Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 03.01.06 11:30 
Die Memo ist immernoch leer (also bei mir steht Memo1 drin) ... Ich habe im Anhang einmal mein kleines Testprogrämmchen.... Ich hoffe es nützt dir was...
Einloggen, um Attachments anzusehen!
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 03.01.06 11:42 
Dann sieht es so aus als ob das OnNewLine Event nicht aufgerufen wird. Das solltest du zu erst mal überprüfen. Hast du die Methode DosCommand1NewLine wirklich mit dem OnNewLine Event verbunden (-> Objektinspektor)?

In Deinem Beispiel Projekt fehlt die Unit ..\v7\Uci\UCI.pas.

Lg Martin

_________________
Ein Nutzer der Ecke ;-)
Lago Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 03.01.06 11:47 
Ja hab ich. Im Objektinsp. ist sie richtig drin...

Jetzt habe ich dir den Kompl. Ordner angehängt... Jetzt sollte es eigentlich Klappen...
Einloggen, um Attachments anzusehen!
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 03.01.06 11:58 
Ich hab das Problem gefunden. Und zwar werden zwei Instanzen von TDosCommand erstellt. Eine automatisch durch Delphi weil du ja die Komponente auf das Form platziert hast und eine weitere von dir manuel im Sourcecode:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
begin
DosCommand1 := TDOSCommand.Create(self);
{DosCommand1.OutputLines:=Memo1.Lines;  }        //DosCommand Output wird in Memo angezeigz
UCIinit;
Edit1.Text:= 'e7e5';              //Test
end;

Das Problem hier bei ist, das Delphi zu erst die Instanze erstellt und auch die Events zuweist. Dann erstellst Du eine neue Instanz und weist diese der gleichen Variable zu. Dadurch "zeigt" diese Variable nicht mehr auf die erste Instanz sondern auf die zweite, die von dir selbst erstellt Instanz. Das heißt, dass Du jetzt zwei Instanzen von TDosCommand hast. Die erste Instanze hat noch die Zuweisung von OnNewLine. Allerdings hast Du auf diese Instanz keinen Zugriff weil die Variable ja auf die zweite Instanz verweist.

Also: entferne die von mir markierte Zeile und es funktioniert. ;-)

lg Martin

_________________
Ein Nutzer der Ecke ;-)
Lago Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 43



BeitragVerfasst: Di 03.01.06 12:03 
Martin... Du glaubst gar nicht wie viele Stunden ich bereits am Computer hocke und
probiere das Problem zu beheben...

DANKE, DANKE, DANKE.... :-)

Ich bin sooooo erleichtert.... Jetzt werde ich noch das grössere Problem Posten... es handelt sich umd das lesen von
Daten über RS232... ABER JETZT KANN ICH WENIGSTENS HIER WEITER MACHEN!! JUPPPPIIIII!!

DANKE!