[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

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

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.  
0
nikola_mk
Asked:
nikola_mk
1 Solution
 
JDuncanCommented:
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
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now