translation from c#

  • Thread starter Thread starter ME
  • Start date Start date
M

ME

Hello,

I need some help translating this code to vb.net

..........
private dotnetWinpCap.ReceivePacket rcvPack=null;
..........

if (rcvPack==null)
{
rcvPack=new dotnetWinpCap.ReceivePacket(this.ReceivePacket);
wpcap.OnReceivePacket+=rcvPack;
}

Thanks for the help.
 
ME said:
I need some help translating this code to vb.net

.........
private dotnetWinpCap.ReceivePacket rcvPack=null;
.........

if (rcvPack==null)
{
rcvPack=new dotnetWinpCap.ReceivePacket(this.ReceivePacket);
wpcap.OnReceivePacket+=rcvPack;
}

\\\
Private rcvPack As dotnetWinpCap.ReceivePacket rcvPack
..
..
..
If rcvPack Is Nothing Then

' Depending on the purpose of the last constructors parameter
' 'AddressOf' might be necessary...
rcvPack = New dotnetWinpCap.ReceivePacket rcvPack(Me.ReceivePacket)
AddHandler wpcap.OnReceivePacket, AddressOf rcvPack
End If
///

Converting code between .NET programming languages
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=languageconverters&lang=en>
 
Which error message do you get?dotnetWinpCap.ReceivePacket is a delegate type (with the new)
is a type and cannot be used as an expression (without the new)
 
You have a little mistake:

should read:

Private rcvPack As dotnetWinpCap.ReceivePacket
 
Chris Dunaway said:
You have a little mistake:


should read:

Private rcvPack As dotnetWinpCap.ReceivePacket

Ooops... Copy and paste seems to be too complicated for me ;-).
 
Back
Top