AsyncHelper for VB.NET

By Fons Sonnemans, posted on

I received a mail today from Rolf Gasber asking me whether I could help him with a VB.NET version of the AsyncHelper which I used in an earlier post. Here it is:


Class AsyncHelper

    Private Delegate Sub DynamicInvokeShimProc( ByVal d As [Delegate], _
ByVal args() As Object )

    Private Shared _dynamicInvokeShim As _
New DynamicInvokeShimProc( AddressOf DynamicInvokeShim)

    Private Shared _dynamicInvokeDone As _
New AsyncCallback( AddressOf DynamicInvokeDone)

    Public Shared Sub FireAndForget( ByVal d As [Delegate], _
ByVal ParamArray args() As Object )
        _dynamicInvokeShim.BeginInvoke(d, args,
AddressOf _
 DynamicInvokeDone, Nothing )
    End Sub

    Private Shared Sub DynamicInvokeShim( ByVal d As [Delegate], _
ByVal args() As Object )
    End Sub

    Private Shared Sub DynamicInvokeDone( ByVal ar As IAsyncResult)
    End Sub





All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.

Leave a comment

Blog comments

0 responses