Autor Beitrag
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 06.10.03 15:04 
hallo !
ich bin mir jetzt nicht so 100%ig sicher dass die frage hier rein passt. aber egal.

der indy TCP server benutzt ja bei allen seinen ereignissen threads. also wenn ich einen request an den server schicke wird doch mein code den ich zur behandlung im execute ereignis benutze in einem thread gestartet.
meine frage:
darf man denn aus diesem thread auch z.b. editfelder ändern ? ich hab da mal was mit synconize gelesen ?? wie setzte ich das richtig ein ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 07.10.03 15:46 
Grundsätzlich dürfen Threads nicht auf Teile andere zugreifen - deine Hauptanwendung ist aber auch ein Thread. Mit der Function Synchronize() kannst du Funktionen aufrufen, die auf VCL Objekte zugreifen. Das BS stellt dann sicher, das alles threadkonform abläuft.

z.b.
Edit1 ist ein Feld der Anwendung und dein Thread Test soll darauf zugreifen können.

1. Übergebe das Editfeld dem Thread und speichere die Referenz in der Threadklasse ab.
2. Schreibe eine Funktion im Thread, die den Text im Editfeld ändert
3. Rufe Snychronize(mit dem Funktionsnamen siehe 2.) auf

fertig.

//edit: schau mal hier:www.delphi-forum.de/...16615&highlight=

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 07.10.03 17:24 
versteh ich nicht. ich steh da komplett aufm schlauch ! :? :? :?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Sa 11.10.03 10:09 
Sehr gutes Tutorial zu Threads: www.pergolesi.demon....rog/threads/ToC.html


MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
matze Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 11.10.03 13:00 
danke, ich werd mir das mal anschauen

_________________
In the beginning was the word.
And the word was content-type: text/plain.