http://bugs.winehq.org/show_bug.cgi?id=27927
--- Comment #3 from ocean04@suomi24.fi 2011-07-31 12:01:30 CDT --- Yes, with that patch example now works. But..
Sorry if making issue more complicated, but something like following should also work. It perhaps shows more clearly, why WaitForResponse needs to process messages. (cancel button / time counter doesn't work, because it consumes all CPU)
Download: http://netikka.net/dev/winhttpwait2.exe
begin cancel:=false; fhttp:=createoleobject('WinHttp.WinHttpRequest.5.1'); fhttp.open('GET', edit1.text, true); fhttp.send(); timer1.enabled:=true; fhttp.WaitForResponse; timer1.enabled:=false; if cancel=true then begin showmessage ('User cancel'); exit; end; memo1.text:=fhttp.Responsetext; ... end;
procedure TForm1.Button3Click(Sender: TObject); begin cancel:=true; fhttp.Abort; fhttp:=unassigned; end;
procedure TForm1.Timer1Timer(Sender: TObject); begin // timer interval is 1 second t:=t+1; label6.caption:='Time: '+inttostr(t); end;