Autor Beitrag
shapeless
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Di 18.10.05 14:16 
Hallo, meine Deutch ist nicht so gut.

Ich habe eine problem mit idTcpServer :(

Wann eine cleint schließt an ich wolle eine neues form create, aber die programme fröste...

(in english: i want to create new form in the OnConnect-procedure, but when i do this the programme freezes).

Regards
Jonas
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Di 18.10.05 14:20 
can you be so kind to give us a piece of code ?
Would be easier to analyze it !

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 18.10.05 14:28 
Hello there!

This is a problem of "thread synchronisation". TIdTCPServer uses one thread per connected client to manage "multi-tasking". When the event "OnConnect" is called, you are not in the context of the VCL-Main-thread which is the only one allowed of using and manipulating VCL-controls. You will have to synchronize with the main thread. Have a look at the SimpleTCP-Unit in the open-source-units-area, the components coded there handle all synchronization issues and call their events in the context of the vcl-main-thread.

Cu,
Udontknow