Hi Brad,
I agree and am also interested in what response you receive to this. I have
been trying to implement a delegate in my app. to return a dataset and for
the time being, I have given up :-(. I have decided to use threading.
However, I'll give you my resp. FWI.
A callback method is used to receive the result of the completed delegate
function. The delegate function must have the same signature (ie. pass same
params, and return same type) as the method whose reference it stores. I
suppose you could consider it as a 'shadow' function of the method it is
referencing.
So, the process I believe goes something like:-
Declare delegate with correct signature
Declare asyncallback (cbk)
Declare iAsynResult (iRes)
Instantiate delegate referencing the method that it is the delegate to: -
ie. delData = New DataDelegate(AddressOf myClass.FuncName)
Instantiate the callback method: - ie. cbk = New AsyncCallback(AddressOf
delDataComplete)
Start the process: - iRes = delData.BeginInvoke([param], cbk, Nothing)
Sub DataComplete (iRes as IAsyncResult)
Dim result as (Type) = delData.EndInvoke(iRes)
End Sub
HTH, Phil
"Brad Rogers" <br*************@yahoo.com> wrote in message
news:_eFVe.18668$vQ3.4589@trnddc08...
HI
Im trying to understand delegates in vb.net and the concept seems very
difficult.
is there a good study guide or something to help grasp this?
callback method?? signature?? Why does the delegate concept seem the
hardest in vb.net?
tia