There are 2 downloader projects attached here. 1 asynchronous project and 1 synchronous project.
The synchronous downloader, vbDownloader.zip, uses the URLDownload API and uses call backs to allow the user to cancel the download and/or show a prog bar.
For this project to work you need to do the following:
Attached is code, plus a demo app, that allows you to download files from the web.
This can be used for auto updates for a client exe etc, or just as a download manager.
One thing you need to do is download the file:
http://www.mvps.org/emorcillo/download/vb6/tl_ole.zip
and extract the 2 tlb files and install them using the instructions provided.
These tlb files are used for the call back to allow the download to be shown in a progress bar, and to allow the user to cancel the download.
The 2nd project "Downloader and Winsock.zip" is an asynchronous downloader that uses a DLL version of the winsock control.
This has a few benefits over the URLDownload method. 1stly it's asynchronous and there you can have multiple downloads at any one time in your app, plus it allows you to use your app while downloading. It also allows you to get the file size of the file before you download it. This I find is very usefull.
However, the URLDownload example allows you to cache the file in the internet cache folder....this can be handy. The winsock does not cache any of the file, and if the download is aborted cancelled you will have to download the whole file from scratch.
Pick ya method
Woka



Reply With Quote


But when I compiled both files (vbWebDownload.dll and DemoDownloadApp.exe) the app didn't work anymore. When trying to download a file the app hangs and after a while says 'Download aborted. Resource not found.' Without error handler it gave me a 'Object variable or With block variable not set' error and an Automation error. Does this happen with anyone else when the app is compiled?
