Introduction
A year ago I wanted to create a large multi-download program. I implemented the
visual interface in VB6 and the actual download functionality in an ATL COM
component. I used the URL monikers and specifically the CBindStatusCallback
ATL
class to implement downloading. Unfortunately the documentation for URL monikers
is poor and I have only scratched the surface of this subject. I have not yet succeeded
in
implementing suspend and resume of downloads. The component also includes some
other useful functions for cache access, URL and resolving of paths. I hope you'll
find it useful. The figure above shows a small VB6 program that simultaneously downloads 3
files from the Microsoft download
site.
Below there is a brief listing of the interface methods. In the source code zip
file,
you'll find also an HtmlHelp, created with my 'Automatic
HTMLHelp Documentation' tool.
Object AsyncDownloader
Interface IAsyncDownloader |
Name | Type | Explanation |
AbortDownload | Method | Abort downloading (does not work) |
ConcurrentDownloads | Property Get/Let | Number of concurrent downloads |
DownloadedBytes | Property Get | Downloaded bytes yet |
MaxBytes | Property Get | Maximum bytes to download |
RequestDownload | Method | Request Download |
ResumeDownload | Method | Resume Download (does not work) |
Status | Property Get | Status of download (in progress, etc.) |
SuspendDownload | Method | Suspend Download (does not work) |
Event Interface _IAsyncDownloaderEvents |
OnData | Event | Data arrived |
OnFinish | Event | Finished downloading |
OnStart | Event | Started downloading |
Object CacheUtils
Interface ICacheUtils |
Name | Type | Explanation |
CrackUrl | Method | Crack Url into a UrlComponents object (host,path,etc.) |
DownloadToFile | Method | Download URL To local file |
MakeSureDirectoryPathExists | Method | Make Sure Directory Path Exists |
PathCombine | Method | Combine paths |
SaveURLfileFromCacheToLocalfile | Method | Save URL file From Cache To Local file |
UrlCombine | Method | Url Combine |
Object UrlComponents
Interface IUrlComponents |
Name | Type | Explanation |
ExtraInfo | Property Get/Let | ExtraInfo |
FullURL | Property Get/Let | FullURL |
HostName | Property Get/Let | HostName |
Password | Property Get/Let | Password |
Port | Property Get/Let | Port |
Scheme | Property Get/Let | Scheme |
UrlPath | Property Get/Let | UrlPath |
UserName | Property Get/Let | UserName |
Object PathUtils
Interface IPathUtils |
Name | Type | Explanation |
GetFullPathName | Method | Get Full PathName |
GetModuleFileName | Method | Get Module FileName |
GetShortPathName | Method | Get Short PathName |
MakeSureDirectoryPathExists | Method | Make Sure Directory Path Exists |
PathCanonicalize | Method | Path Canonicalize |
PathCombine | Method | Path Combine |
PathCommonPrefix | Method | Path Common Prefix |
PathFindFileName | Method | Path Find FileName |
PathIsDirectory | Method | Path Is Directory |
PathIsFileSpec | Method | Path Is File Spec |
PathIsPrefix | Method | Path Is Prefix |
PathIsRelative | Method | Path Is Relative |
PathIsRoot | Method | Path Is Root |
PathIsSameRoot | Method | Path Is Same Root |
PathIsUNC | Method | Path Is UNC |
PathIsURL | Method | Path Is URL |
PathMatchSpec | Method | Path Match Spec |
PathQuoteSpaces | Method | Path Quote Spaces |
PathRelativePathTo | Method | Path Relative Path To |
PathRemoveArgs | Method | Path Remove Args |
PathRemoveBackslash | Method | Path Remove Backslash |
PathRemoveBlanks | Method | Path Remove Blanks |
PathRemoveExtension | Method | Path Remove Extension |
PathRemoveFileSpec | Method | Path Remove File Spec |
PathRenameExtension | Method | Path Rename Extension |
UrlCombine | Method | Url Combine |
Software developer and Microsoft Trainer, Athens, Greece (MCT, MCSD.net, MCSE 2003, MCDBA 2000,MCTS, MCITP, MCIPD).