Autor Beitrag
N1m3
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30


Borland Delphi 2005 Personal
BeitragVerfasst: Sa 05.11.05 00:08 
Hi

Wie schon im Titel steht, möchte ich eine Aktion erst ausführen wenn die Webseite im Webbrowser1 fertig geladen wurde. Die Aktion spielt sich in einer längeren Schlaufe ab.

Wie kann ich jetzt prüfen ob die Seite geladen wurden, und falls, wie weiter?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var
n: Integer;
begin
// test -> if complete then -> start
for n:=0 to Memo1.Lines.Count do begin
  if WebBrowser1.ReadyState < READYSTATE_COMPLETE then
  // jetzt aktion ausführen
  // aber hier kommt immer die fehlermeldung: 
  // Access violation at adress ... 
 end;
end;



Gibt es auch noch eine andere Möglichkeit zu testen ob Seite fertig geladen wurde?
hab auch mit OnDocumentComplete versucht, leider auch ohne Erfolg, da es zu wenig Parameter anscheinend hatte:

ausblenden Delphi-Quelltext
1:
if Webbroser1.OnDocumentComplete = 1 then					



Gruss
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 05.11.05 00:29 
Für was verwendest du eine For-Schleife und ein Memo?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 05.11.05 01:06 
for n:= 0 to Memo1.Lines.Count - 1 do muss es heißen!
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Sa 05.11.05 01:54 
Hallo,

falls der richtige Hinweis von Luckie nicht Dein Problem beseitigt,
könnte Dir eventuell das weiterhelfen, dort gab es ein ähnliches(gleiches) Problem:
...alles schon probiert, einzelt geht es, aber wie gesagt sobalt der code inner schleife ist kann ich ...

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 05.11.05 09:51 
user profile iconLuckie hat folgendes geschrieben:
for n:= 0 to Memo1.Lines.Count - 1 do muss es heißen!

Das Problem ist hier aber, dass ich gar nicht sehe ob er n nochmal verwendet oder ob er bloß ne Schleife haben will.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Sa 05.11.05 10:25 
Der WebBrowser sagt Dir doch, wann das "Document complete" geladen wurde. Das 'OnDocumentComplete' ist ein Ereignis, das eintritt, wenn das Dokument komplett ist. Doppelklicke im Objektinspektor im Reiter 'Events' auf den Eintrag und schreibe dort den Code rein, der ausgeführt werden woll, wenn dieses Ereignis eintritt.

_________________
Na denn, dann. Bis dann, denn.