Autor Beitrag
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Mo 30.07.07 15:32 
Servus,

auch wenn diese Frage schon 9 mal angegeben wurde, doch noch eine Kleinigkeit:

Ich arbeite mit einem Thread, der Synchronize aufruft.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure Thread.Execute();
begin
  Synchronize(UpdateStatusLabel);
end;


Dieser ruft dabei folgende Methode aufruft:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure Thread.UpdateStatusLabel();
begin
  Form1.SetLabelText('blub');
end;


Und im Form1 dann:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure Form1.SetLabelText(s:string);
begin
  Label1.Caption := s;
end;


Jetzt kommt bei dem "Label1.Caption" manchmal eben besagte und auch bekannte Fehlermeldung "Leinwand/Bild erlaubt kein Zeichnen".

Kann mir jemand sagen was ich falsch mache? Eigentlich mach ich doch genau ein Aufruf mit Synchronize damit sowas NICHT passiert oder?!?
cartridge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 209

Win XP
D4 Prof,D6 Prof
BeitragVerfasst: Di 07.08.07 18:44 
Hi!

Bist Du sicher, dass das der Grund ist? Oder hast Du noch anderes auf Lager, was auf einen Canvas zeichnen oder schreiben will? Die Meldung kommt auf alle Fälle von einem Canvas.

Gruß Ingo

_________________
====================
Na klar bin ich sicher!!! Oder..?