473,395 Members | 1,936 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,395 software developers and data experts.

Need help with exception message


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.

Nov 21 '05 #1
7 893
<guy> schrieb:
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)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2
&HC0A80201 extends range of integer. Use &HC0A80201L to express long(int64)
data.

"guy" wrote:

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.

Nov 21 '05 #3
I forgot that a new without parameters requires a parameterless
constructor.

Thanks.
Nov 21 '05 #4
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.
Nov 21 '05 #5
<guy> schrieb:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6
> 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.

Nov 21 '05 #7
This may seem strange, but on dot net cf it *will* work
without the long cast.
Nov 21 '05 #8

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

Similar topics

0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
5
by: Michael S. Kolias | last post by:
I have a stored procedure that I call from an aspx page but for some weird reason i get this error message: Procedure 'sp_insert_customer' expects parameter '@username', which was not supplied. ...
4
by: Johannes Hansen | last post by:
What are the best practice on handling an exception caused by a Dispose method when its called from inside a loop? Wrap the entire loop in a try-catch or do the try-catch on each iteration to get...
8
by: John Bowman | last post by:
Hello, Does anyone have a good/reliable approach to implementing an IsNumeric() method that accepts a string that may represent a numerical value (eg. such as some text retrieved from an XML...
1
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this....
2
by: Charles | last post by:
I need to find a way to share information between two classes, one is an employee class and the other is a custom error class that inherits from ApplicationException. These two classes are part of...
2
by: Keith Kowalski | last post by:
I anm opening up a text file reading the lines of the file that refer to a tif image in that file, If the tif image does not exist I need it to send an email stating that the file doesn't exist...
9
by: Bill Borg | last post by:
Hello, I call a function recursively to find an item that exists *anywhere* down the chain. Let's say I find it five layers deep. Now I've got what I need and want to break out of that whole...
7
by: Charlie Brookhart | last post by:
I have a program (posted below) that is supposed to take liters, which is the user input, and convert it to pints and gallons. The pints and gallons are displayed in a read only textbox. I don't...
6
by: zaina | last post by:
hi everybody i am nwebie in this forum but i think it is useful for me and the member are helpful my project is about connecting client with the server to start exchanging messages between...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.