Part of a Visual Basic program is being moved to .NET dll.
Parameter call can be passed successfully & everything run fine.
How can I pass a callback function of VB6 for .NET to call after a long running async task?
In .NET
Public Delegate Function VBCallBackFunc() As Integer
Public Function DoSomething(a As String, b As String, c As String, _
parent As IntPtr, Optional ByVal CallbackAddr As VBCallBackFunc = Nothing) As Boolean Implements _DotNetLib.DoSomething
VB6
result = DotNetLib.DoSomething(strA, strB, strC, Me.hwnd, AddressOf DotNetCallback)
Public Function DotNetCallback() As Long
MsgBox ("Callback")
End Function
In object browser of VB:
Function DoSomething(strA As String, strB As String, strC As String,
parent As Long, [CallbackAddr As VBCallBackFunc]) As Boolean
Member of DotNetLib
But it said "Invalid use of AddressOf operator" ???