Re: Multi-Threaded 'Get' Example (General questions)
Hi Greg,
Unfortunately, when declaring component as array, WithEvents statement is invalid. However, you can do something like this:
[code]Option Explicit
Dim http(5) As wodHttpDLXCom
Implements IwodHttpNotify
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 4
Set http(i) = New wodHttpDLXCom
Set http(i).Notification = Me
Next
End Sub
Private Sub IwodHttpNotify_ClientCertRequired(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom)
End Sub
Private Sub IwodHttpNotify_Connected(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom)
End Sub
Private Sub IwodHttpNotify_Disconnected(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, ByVal ErrorCode As Long, ByVal ErrorText As String)
End Sub
Private Sub IwodHttpNotify_Done(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, ByVal ErrorCode As Long, ByVal ErrorText As String)
End Sub
Private Sub IwodHttpNotify_HeadersDone(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom)
End Sub
Private Sub IwodHttpNotify_HostCertificate(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, ByVal Cert As wodHttpDLXComLib.ICertificate, ByVal ErrorCode As Long, ByVal ErrorText As String, Accept As Boolean)
End Sub
Private Sub IwodHttpNotify_Progress(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, ByVal Position As Long, ByVal Total As Long)
End Sub
Private Sub IwodHttpNotify_Redirect(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, URL As String, Allow As Boolean)
End Sub
Private Sub IwodHttpNotify_StateChange(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, ByVal OldState As wodHttpDLXComLib.HttpStates)
End Sub
Private Sub IwodHttpNotify_Progress64(ByVal Owner As wodHttpDLXComLib.IwodHttpDLXCom, ByVal PositionLo As Long, ByVal PositionHi As Long, ByVal TotalLo As Long, ByVal TotalHi As Long)
End Sub
[/code]
In this sample, I used Notification interface. In this case, each method (event) has Owner parameter which provides you with reference to instance of component that raised the event. Can you try something like that?
As for using blocking, you're correct. Each method that is executed will block the rest of the code until it finishes executing. To avoid that you should use Events.
Regards,
Damba
Complete thread:
- Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 17:26
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 17:31
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 17:48
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 18:29
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 18:55
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 19:14
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 19:44
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 19:49
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 19:52
- Re: Multi-Threaded 'Get - ActiveGreg, 2009-02-23, 19:55
- Re: Multi-Threaded - ActiveGreg, 2009-02-23, 20:02
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 20:27
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 20:44
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 20:50
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 21:03
- Re: Multi-Threaded 'Get - ActiveGreg, 2009-02-27, 02:29
- Re: Multi-Threaded - woddrazen, 2009-02-27, 09:03
- Re: Multi-Threaded - ActiveGreg, 2009-03-08, 20:42
- Re: Multi-Threaded - woddrazen, 2009-02-27, 09:03
- Re: Multi-Threaded 'Get - ActiveGreg, 2009-02-27, 02:29
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 21:03
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 20:50
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 20:44
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 20:27
- Re: Multi-Threaded - ActiveGreg, 2009-02-23, 20:02
- Re: Multi-Threaded 'Get - ActiveGreg, 2009-02-23, 19:55
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 19:52
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 19:49
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 19:44
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 19:14
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 18:55
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 18:29
- Re: Multi-Threaded 'Get' Example - ActiveGreg, 2009-02-23, 17:48
- Re: Multi-Threaded 'Get' Example - wodDamir, 2009-02-23, 17:31