[mono-vb] VB.NET AddressOf operator

Jesse van den Kieboom jesse at icecrew.nl
Wed Aug 24 07:51:10 EDT 2005


Hi,

I'm quite new to VB.NET and mono and I'm having the following problem.
I'm trying to pass a function as an argument to a sub. The sub should
then execute the 'callback' and use its return value.

I declared a delegate:
Public Delegate Function HandlesType(type As Type) As Boolean

Further on I have the sub:
Protected Sub FindClasses(pHandles As HandlesType)

And a call:
FindClasses(New HandlesType(AddressOf CheckInterfaceType))

CheckInterfaceType conforms to the delegate declaration. Now mbas
(invoked from monodevelop) gives me the following error: 

Could not find delegate constructor

at: FindClasses(New HandlesType(AddressOf CheckInterfaceType))

I've tried the same construction in SharpDevelop win32 (not mono) and it
worked fine. Is this a known issue?

Also a delegate doesn't seem to have an Invoke method which it does have
in win32.


Regards,


Jesse van den Kieboom



More information about the Mono-vb mailing list