I'm having trouble running my code in a tthread object. Its supposed to go through all the links in twebbrowser and then copy it to a memo if the url contains 'http://www.ebay.com/itm/'. The code works perfectly in in the mainform but doesn't work in a tthread object.
My Code:
begin
count := 0;
loop := 0;
repeat
link := Webbrowser1.OleObject.Document.Links.Item(loop).href;
if AnsiContainsStr(link, 'http://www.ebay.com/itm/') then
begin
Form1.Memo1.Lines.Add(link);
end;
end;
loop := loop + 1;
count := count + 1;
until count = Webbrowser1.OleObject.Document.links.Length;
end;
The error I'm getting
Access violation at address xxxxxx in module mshtml.dll
Thanks for reading and all replies.