Hallo,
ich habe mir eine kleine Applikation (zu Übungszwecken Thema Threads) geschrieben, die einen Threads startet, der regelmässig im Netzwerk einen anderen Rechner anpingt:
Delphi-Quelltext
1: 2: 3:
| Hauptprogramm (im Formcreate): Ping:= TPingThread.Create(Host2Ping, PingTimeout, PingWait, tpLower); |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| Thread:
procedure TPingThread.Execute; begin PingComp:=TPing.Create(nil); PingComp.TTL:=64; PingComp.Timeout:=PingTimeout; PingComp.Tag:=0; PingComp.Size:=56; PingComp.Flags:=0; PingComp.OnDnsLookupDone:=PingDnsLookupDone; PingComp.OnEchoRequest:=PingOnEchoRequest; PingComp.OnEchoReply:=PingOnEchoReply; refresh:=false; while not Terminated do begin DNSLookupDone:=false; PingComp.DnsLookup(Host2Ping); while not DNSLookupDone and not Terminated do begin end; refresh:=false; while not refresh and not Terminated do begin PingDone:=false; PingComp.Ping; while not PingDone and not Terminated do begin end; sleep(PingWait); end; end; PingComp.Free; end; |
Prinzipiell geht auch alles - ausser wenn ich ein Setup eines (beliebigen anderen) Programmes starte - dann kommt die Prozentanzeige, die bleibt bei 99% hängen und erst wenn ich mein Thread-Programm beende, startet das Setup.
Ich habe irgendwo gelesen, daß Installshield an die laufenden Programme verschiedene Messages sendet und auf antwort wartet ?
Kann mir jemand weiterhelfen ? Die Ausgabe aus dem Thread heraus mache ich i.ü. mittels Sychronize, so wie sich das gehört
lg
Moderiert von
Motzi: Code- durch Delphi-Tags ersetzt.