How to calc download progress in WinINet async mode?

Started by
3 comments, last by Teric 18 years, 7 months ago
I'm using the WinINet function InternetReadFileEx to download a file in async mode. I need to be able to determine the download progress so I can show a progress bar on the screen. I've attempted to use the dwBufferSize member of the INTERNET_BUFFERS structure that I pass to InternetReadFileEx, but it always contains 0 until the download is complete, and then it suddenly contains the full file size. Does anyone know a better way to see file download progress? Thanks in advance!
I am always open to feedback, positive or negative...
Advertisement
This is just a long shot, but be aware of that when downloading some files, proper headers are not given about the its size, in which case (seen in IE) when downloading files, the progress stays at 0% until the file is finished and then jumps to 100%.


Yes that's true. But I've already made sure that these files have proper headers. I use HttpQueryInfo to grab the file size before the download starts, and that works just fine.
I am always open to feedback, positive or negative...
*Bump*

Anyone know how to do this?
I am always open to feedback, positive or negative...
I guess this one is a real stumper. I've tried posting this on the Microsoft developer newsgroups and nobody there seems to know how to do this.

There's got to be someone here at GameDev that has done this before?
I am always open to feedback, positive or negative...

This topic is closed to new replies.

Advertisement