Help with Wininet.My project is like freeze when i am downloading file from internet

nikola_mk
nikola_mk used Ask the Experts™
on
I am using Wininet for downloadng files from internet.When i start with downloading hole project  is freezing up.While buffer (in InternetReadFile )  is loading  hole project is freezed and after that project is litle bit released and then again hole project is freezed.I thried with small buffer (256,1024) and with "Application.Processmessage" function but problem is not solved.  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Are you using some thing like the following the following

      InternetReadFile(handle,addr(mybuffer),sizeof(mybuffer),DataLen);
     for i:=0 to 100 do  Application.ProcessMessage;

The effect changing the buffer size has will depend on the tcp routing buffer (around 1024 bytes of data).

You could try putting multiple appprocess messages in a for loop as above

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial