By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 3,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

Calling VB.NET method from C#

P: n/a
Hi,

I do have the VB.NET method which has delegate as parameter.
I am calling this method from VB.NET project by using the commnad "Addressof( Function name which has same signature)".
How can i call the same method from C# Project?

Code Sample:

Delegate Definition on class inwhich VB.NET method is located.
Public Delegate Function fnRejectDelegate(ByVal dr As DataRow) As Boolean

VB.NET method definition.

Public Function GetFirstPage(ByVal pSize As Int16, ByVal delReject As fnRejectDelegate) As DataTable

Calling statement in VB.NET project

dtTemp = ctaTicketManager.GetFirstPage(5, AddressOf reject)

Function in VB.NET project with same delegate signature

Private Function reject(ByVal dr As DataRow) As Boolean

End Function

Since we don't have equivalent for "Addressof" operator in C#, how can we call the same method from C# project?

Thanks,

Vijay

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
bool reject(DataRow dr)
{
}

dtTemp = ctaTicketManager.GetFirstPage(5, new fnRejectDelegate(reject));

-- bruce (sqlwork.com)

"Vijay" <vi***@infosysusa.com> wrote in message news:up****************@TK2MSFTNGP12.phx.gbl...
Hi,

I do have the VB.NET method which has delegate as parameter.
I am calling this method from VB.NET project by using the commnad "Addressof( Function name which has same signature)".
How can i call the same method from C# Project?

Code Sample:

Delegate Definition on class inwhich VB.NET method is located.
Public Delegate Function fnRejectDelegate(ByVal dr As DataRow) As Boolean

VB.NET method definition.

Public Function GetFirstPage(ByVal pSize As Int16, ByVal delReject As fnRejectDelegate) As DataTable

Calling statement in VB.NET project

dtTemp = ctaTicketManager.GetFirstPage(5, AddressOf reject)

Function in VB.NET project with same delegate signature

Private Function reject(ByVal dr As DataRow) As Boolean

End Function

Since we don't have equivalent for "Addressof" operator in C#, how can we call the same method from C# project?

Thanks,

Vijay

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.