Autor Beitrag
Jojojoxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Sa 12.01.08 22:06 
Hallo!

Ich habe folgende Situation.

Ich möchte, dass wenn mein Programm beendet wird ein String per TClientSocker verschickt wird. Das Problem dabei ist, dass die Verbindung zum Server hergestellt wird, und das Senden des Strings im Ereignis OnConnect stattfindet. OnCloseQuery wartet natürlich nicht dieses Ereignis ab, sondern beendet direkt nach "ClientSocket.open" das Programm.
Habt ihr eine Idee, wie ich das umsetzen könnte?
Danke euch!
mfg

Jojo
Zorro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win 2000, Win XP Pro
Delphi 7 Architect
BeitragVerfasst: Mo 14.01.08 19:24 
user profile iconJojojoxx hat folgendes geschrieben:

OnCloseQuery wartet natürlich nicht dieses Ereignis ab, sondern beendet direkt nach "ClientSocket.open" das Programm.


Aber nur, wenn du den Parameter "CanClose" auf dem Vorgabewert True belässt.

Greetz
Zorro
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 14.01.08 19:33 
Moin!

Zwei Alternativen:
  1. Blocking-Socket-Calls verwenden. Nachteil: Die Anwendung "hängt" in der Zeit.
  2. Anwendungszustand verwenden, im OnCloseQuery die Aktion(en) anstoßen aber das Schließen verhindern, dann am Ende der Ereigniskette einfach selbst Close aufrufen und die Anwendung zu machen. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.