|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
translation from c#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.
http://www.kamalpatel.net/
ME wrote: Show quoteHide quote >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" <inva***@invalid.com> schrieb: \\\> 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> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> thanks, but I can't get it to work
it's a simple sample application from http://www.codeproject.com/dotnet/dotnetwinpcap.asp but I can't get it to work in vb.net Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:OYbu7c1OFHA.3788@tk2msftngp13.phx.gbl... > "ME" <inva***@invalid.com> schrieb: >> 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> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> "ME" <inva***@invalid.com> schrieb: Which error message do you get?> thanks, but I can't get it to work -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> > 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) > Which error message do you get? this is my receivepacket:> Sub ReceivePacket(ByVal sender As Object, ByVal p As PacketHeader, ByVal s As Byte) You have a little mistake:
>> Private rcvPack As dotnetWinpCap.ReceivePacket rcvPack should read:Private rcvPack As dotnetWinpCap.ReceivePacket "Chris Dunaway" <dunaw***@gmail.com> schrieb: Ooops... Copy and paste seems to be too complicated for me ;-).> You have a little mistake: > >>> Private rcvPack As dotnetWinpCap.ReceivePacket rcvPack > > should read: > > Private rcvPack As dotnetWinpCap.ReceivePacket -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
2 easy questions
How to convert hex to string? Difference between Trim function and Trim member New To Imaging DateTimePicker Bug? How to get form design view back? sending string thru TCP/IP Can I pass value from VB form to VBS? Using MSCOMM32.ocx with VB.net listboxes to select/deselect multiple items |
|||||||||||||||||||||||