Click to See Complete Forum and Search --> : FTP through Wininet.dll with progress shown


Sang
April 1st, 1999, 05:17 PM
Hi.

Does anybody know how to use the wininet.dll though api to connect to a server, and download a file with progress showing?

i've gotten the Connecting and downloading to work so far, but i'm stuck at the showing progress.

Any help would be appreciated

Thank you
Sang

Ravi Kiran
April 3rd, 1999, 12:36 AM
Hi,

Try the Inet Ocx instead. I think, the same wininet.dll is packed into a ocx for VB users. Select the 'Microsoft Internet Transfer Control' (MSINET.ocx). [Project-Controls] menu.

This ocx supports GetChunk method using which you can get chunks of data and
as each chunk is succesfully recieved, you can update a progress bar.

Ravi
ps; Please refer to MSDN for exact usage. I think you have to use .Execute with "Open" or something..

Gordito Supreme
April 5th, 1999, 10:27 AM
I believe you can use GetRemoteFileSize() from the Wininet API to get the file size. Then use the function that tells you the bytes available to read. Then before you actually read the bytes use the GetTickCount() API function. Then perform the read function, and when the bytes are read use the GetTickCount() again. Then divide the bytes read by the milliseconds elasped(subtract the tick counts) to get kps. You perform this in a loop until the entire file is read.

Gordito Supreme