CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    13

    FTP through Wininet.dll with progress shown

    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


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: FTP through Wininet.dll with progress shown

    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..


  3. #3
    Join Date
    Apr 1999
    Posts
    45

    Re: FTP through Wininet.dll with progress shown

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured