![]() |
Source Code |
![]() |
![]() |
5 | Internet |   |
Asynchronous Transfer Component |
Download files and data asynchronously from the Internet |
|
  |
Overview |
Proving that things don't have to be complicated to be really useful, this ActiveX DLL from
Dion Wiggins (dionwiggins@hotmail.com) allows
you to manage as many asynchronous data downloads from the Internet as you want.
Code is provided in VB6 format, but is compatible with VB5 and can quite easily be loaded
(ignore any errors thrown by VB5 and delete the lines which cause an error!)
A VB5 binary is also provided in case you have problems.
|
Description |
This DLL performs asynchronous transfers from the net. There is no limit to
the number of transfers that it can do at once, so long as the key you pass
is unique.
The DLL is implemented as a wrapper to an invisible form which contains a single instance of a private usercontrol. Usercontrols have a lot of this functionality already built in, and it is a simple case of wrapping it to make it work as a DLL. The included demo application transfers a vbAccelerator logo 50 times. |
Coding with the DLL |
There is one Method:
DownloadFile( _ ByVal strFileKey As String, _ ByVal strPath As String, _ ByVal lngFileType As enumDownloadFileTypes, _ ByVal strData As String) As Boolean If the transfer is started successfully then True is returned, otherwise False. An error may be raised by the control if you are not connected to the Internet (see Determining Whether There is an Internet Connection).
Public Enum enumDownloadFileTypes dftFile = 1 dftPicture = 2 dftPicture16 = 3 dftPicture32 = 4 dftByteArray = 5 End Enum And there are two events: Event FileReadComplete( _ ByVal strFileKey As String, _ ByVal lngFileType As enumDownloadFileTypes, _ AsyncProp As AsyncProperty, _ ByVal strData As String) Event FileReadProgress( _ ByVal strFileKey As String, _ ByVal lngFileType As enumDownloadFileTypes, _ AsyncProp As AsyncProperty, _ ByVal strData As String) The values for both events are the same, and the AsyncProp object is documented in Visual Basic by the AsyncProperty object. |
Back to top
Back to Source Code
![]() |
|
About Contribute Send Feedback Privacy
|