An help with Delegates

E

Exch

Hello, I need a little help about Delegates, that I am using right now
for first time. I have a web control used in a form. Id like to pass
to this control a function pointer.

In the web control, I have defined a delegate and I have created a
variable of this type:

Public Delegate Sub SQLDisponibileToAttivo(ByVal
lintCodTipologiaInformazione As Integer)

Public F_SQLDisponibileToAttivo As SQLDisponibileToAttivo


Some lines after, in a sub, I invoke the delegate:
F_SQLDisponibileToAttivo.Invoke(1)


In the form in which is defined the web control, I try to pass the
function to the delegate:

Dim objFrequenzeTemporali_Controller As New
FrequenzeTemporali_Controller
dlaFrequenzeTemporali.F_SQLDisponibileToAttivo = New
DualListAdvanced.SQLDisponibileToAttivo(AddressOf
objFrequenzeTemporali_Controller.FB_GetFrequenzeTemporaliDisponibili)

Note:
DualListAdvanced is the class name of web control
dlaFrequenzeTemporali is an object of DualListAdvanced class
objFrequenzeTemporali_Controller is the name of an object that
contains the function I have to pass to delegate, it is an object used
by DotNetNuke for database accessing

The problem is that when I invoke the function
F_SQLDisponibileToAttivo.Invoke(1), it rises an exception
(NullReferenceException). When I debug, F_SQLDisponibileToAttivo is
Nothing.

Can you give me a suggestion?
Thank you
Exch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top