I tried to implement a callback as described in the MSDN Mag article 2003/1 p105ff 'Implementing Callbacks'.
I have no idea, of what could be different in my code, but for some reason, I get an error in form of a code outline:
Delegate Function FormatDBRows(ByVal objA As ArrayList) As String
'-----------------------------------------------------------
Public Class DBRow
Private obj As Object
Private objFields As System.Collections.ArrayList
Private objHandler As FormatDBRows
Public Sub New(ByVal iNrOfFields As Integer)
objFields = New ArrayList(iNrOfFields)
End Sub
Public Property Item(ByVal iItemNr As Integer) As Object
Get
Return objFields.Item(iItemNr)
End Get
Set(ByVal Value As Object)
objFields.Item(iItemNr) = Value
End Set
End Property
''objH' cannot expose a Friend type outside of the Public class 'DBRow'.
Public Sub RegisterHandler(ByVal objH As FormatDBRows)
Me.objHandler = objH
End Sub
Overrides Function ToString() As String
Dim strFormatedString As String
strFormatedString = Me.objHandler.Invoke(objFields)
Return "strFormatedString"
End Function
End Class
'-----------------------------------------------------------
The portion "FormatDBRows" of the Sub RegisterHandler is being underlined with the tooltip:
'objH' cannot expose a Friend type outside of the Public class 'DBRow'.
Any ideas?
Thank you,
Wolfgang