473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

translation from c#

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.

Nov 21 '05 #1
8 2199
http://www.kamalpatel.net/

ME wrote:
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.



Nov 21 '05 #2
"ME" <in*****@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/>
Nov 21 '05 #3
ME
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

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OY**************@tk2msftngp13.phx.gbl...
"ME" <in*****@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/>

Nov 21 '05 #4
"ME" <in*****@invalid.com> schrieb:
thanks, but I can't get it to work


Which error message do you get?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5
ME
> 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)

Nov 21 '05 #6
ME
Which error message do you get?

this is my receivepacket:

Sub ReceivePacket(ByVal sender As Object, ByVal p As PacketHeader, ByVal s
As Byte)
Nov 21 '05 #7
You have a little mistake:
Private rcvPack As dotnetWinpCap.ReceivePacket rcvPack


should read:

Private rcvPack As dotnetWinpCap.ReceivePacket

Nov 21 '05 #8
"Chris Dunaway" <du******@gmail.com> schrieb:
You have a little mistake:
Private rcvPack As dotnetWinpCap.ReceivePacket rcvPack


should read:

Private rcvPack As dotnetWinpCap.ReceivePacket


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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt | last post by:
Short Description: The Translation Hub is not picking up the TNS names file. I'm using Oracle 9ids. It doesn't work for any users and it has never worked since it's been installed. Long...
40
by: Chiwa | last post by:
Hey, Expression: Math.floor(x * 100) / 100 x= 4.1 gives 4.09, why in gods name? While other values for x don't give a problem. Thx in advance
5
by: Haines Brown | last post by:
I suspect this is a FAQ, but as a guide to my further investigation, I wondered what the options are for providing readers of my web pages with the ability to translate the pages into their own...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
7
by: Peter Eisentraut | last post by:
Greetings. The official PostgreSQL documentation has been translated to German and has been published as a book by verlag moderne industrie/mitp ("PostgreSQL: Das offizielle Handbuch", ISBN...
4
by: Chris Croughton | last post by:
Does a translation unit have to have at least one externally visible declaration or function definition to be valid? As I read the standard, it doesn't: it must have at least one declaration or...
2
by: James | last post by:
In oracle I can do the following: select CONVERT(COLUMNOFNAMES,'US7ASCII') from mytable -- It will take a name like Albrecht Dürer and change it into Albrecht Durer and is useful in where...
1
by: dilabox | last post by:
Hello, I have overloaded the global new, delete, new and delete operators inside a "static library". The library uses private memory allocation routines that must not be accessible from other...
4
by: Tomás Ó hÉilidhe | last post by:
I have a translation unit which defines a global object: BEGIN "yellow.c" int i = 7; END I want this object to be accessible from other translation units, so I give it external linkage....
0
by: Stef Mientki | last post by:
hello, I've build a translation tool, to translate all strings in a python source file. As a extra gadget I added translation through Babel Fish, using beautifulsoup. Although it works...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.