Need help with exception message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am doing the following and getting an exception, any thoughts?

Dim endpoint As IPEndPoint = Nothing

endpoint = New IPEndPoint(&HC0A80201, 5000) '192.168.2.1



An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred
in system.dll

Additional information: Specified argument was out of the range of valid
values.
 
I am doing the following and getting an exception, any thoughts?

Dim endpoint As IPEndPoint = Nothing

endpoint = New IPEndPoint(&HC0A80201, 5000) '192.168.2.1



An unhandled exception of type 'System.ArgumentOutOfRangeException'
occurred
in system.dll

Additional information: Specified argument was out of the range of valid
values.

\\\
Dim endpoint As New IPEndPoint(&HC0A80201&, 5000)
///
 
It works without the L as well, but I agree it is
better to specify the L for clarity. The problem was
(I believe) that when we use new for that type we
must supply parameters because there is no definition
for new() only for new(param) etc.

Thanks.
 
It works without the L as well, but I agree it is
better to specify the L for clarity. The problem was
(I believe) that when we use new for that type we
must supply parameters because there is no definition
for new() only for new(param) etc.

Huh! Take a look at your code again... You are already calling the
parameterized constructor. The problem is definitely that VB.NET treats the
hex number as 'Int32' and treats it as a negative number.
 
Huh! Take a look at your code again... You are already calling the
parameterized constructor. The problem is definitely that VB.NET treats the
hex number as 'Int32' and treats it as a negative number.

Sorry, you are absolutely right. I'm afraid my program has other problems
as well, hence I did not see why the L *is* needed. Thanks, and apologies
and thanks to the first replyer too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top