[mono-vb] Issue with callback/delegate

Rolf Bjarne Kvinge rolflists at ya.com
Mon Apr 27 11:11:31 EDT 2009


Hi, 

This works for me, which version of vbnc are you using? (Open a terminal and
type 'vbnc' will show you).

My sample:
''''''''''''''''''''''''''''
class HPdfDoc

 Public Delegate Sub HPDF_ErrorHandler(ByVal error_no As UInteger, ByVal
detail_no As UInteger, ByVal user_data As IntPtr) 
 Dim error_handler As New HPDF_ErrorHandler(AddressOf HPdfDoc.ErrorProc)

 Public Shared Sub ErrorProc(ByVal error_no As UInteger, ByVal detail_no As
UInteger, ByVal user_data As IntPtr)
     Throw New Exception("")
 End Sub

End Class
''''''''''''''''''''''''''''

Rolf

> -----Original Message-----
> From: mono-vb-bounces at lists.ximian.com [mailto:mono-vb-
> bounces at lists.ximian.com] On Behalf Of Klaus Siebke
> Sent: lunes, 27 de abril de 2009 9:42
> To: mono-vb at lists.ximian.com
> Subject: Re: [mono-vb] Issue with callback/delegate
> 
> 
> Hi Rolf,
> 
> as you told me, I've tried:
> 
> Dim error_handler As New HPDF_ErrorHandler (AddressOf
> HPdfDoc.ErrorProc)
> 
> ... which gives me these compiler errors:
> 
> [Task:File=, Line=0, Column=0, Type=Error, Priority=Normal,
> Description=Int64_Int32(option)]
> [Task:File=/share/source/mono/vbnet/vbharutest/vbharutest/<MyGenerator>
> ,
> Line=1, Column=1, Type=Error, Priority=Normal, Description=Unexpected
> error:
> There has been an internal error in the compiler:(VBNC99999)]
> 
> Have I missed something?
> 
> //Klaus
> 
> 
> 
> 
> Rolf Bjarne Kvinge-2 wrote:
> >
> >
> > This is not correct VB (8), you need to do:
> >
> > Dim error_handler As New HPDF_ErrorHandler (AddressOf
> HPdfDoc.ErrorProc)
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Issue-with-
> callback-delegate-tp23244124p23251516.html
> Sent from the Mono - VB mailing list archive at Nabble.com.
> 
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb



More information about the Mono-vb mailing list