[Bug 27927] Winhttprequest WaitForResponse should process messages

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jul 31 12:01:30 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=27927

--- Comment #3 from ocean04 at 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;

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list