| | |
Integer overflow in vb.net 2005
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Solved Threads: 0
Hi all,
I am pretty new to vb.net and as such facing a pretty simple.
I have an application which is finally going to call a function defined in a dll.
The function declares a variable of type unsigned long
int funct(unsigned long lvar);
The size of unsigned long on my machine in 4 bytes.
Now in vb.net (I am using VS 2005 express) app, I have declared a variable(lvar) of type int32.
In the vb.net app, I am giving the variable (lvar) a value equal to "He443ea12"
(decimal value = 3829656082 )
This value is greater than the max value of the type int32.( max value = 2,147,483,647)
After this I am calling the function funct(lvar), defined in the dll, in the usual way.
Everything is working fine with the function doing it's intended purpose.
However, I read in some article that vb.net raises an exception as soon as it detects the
integer getting overflowed. In my app, integer overflow is clearly taking place ,but still I
am not getting any exception from my app.
Can somebody please point out where I am wrong?
PS I cannot use uint32 in my app so as to make the app CLS compliant. Also I cannot use Int64 as
the variable in my dll is of 4 bytes and hence it's usage is giving me the stack
imbalance problem.
I am pretty new to vb.net and as such facing a pretty simple.
I have an application which is finally going to call a function defined in a dll.
The function declares a variable of type unsigned long
int funct(unsigned long lvar);
The size of unsigned long on my machine in 4 bytes.
Now in vb.net (I am using VS 2005 express) app, I have declared a variable(lvar) of type int32.
In the vb.net app, I am giving the variable (lvar) a value equal to "He443ea12"
(decimal value = 3829656082 )
This value is greater than the max value of the type int32.( max value = 2,147,483,647)
After this I am calling the function funct(lvar), defined in the dll, in the usual way.
Everything is working fine with the function doing it's intended purpose.
However, I read in some article that vb.net raises an exception as soon as it detects the
integer getting overflowed. In my app, integer overflow is clearly taking place ,but still I
am not getting any exception from my app.
Can somebody please point out where I am wrong?
PS I cannot use uint32 in my app so as to make the app CLS compliant. Also I cannot use Int64 as
the variable in my dll is of 4 bytes and hence it's usage is giving me the stack
imbalance problem.
![]() |
Similar Threads
- sending sms using vb.net (VB.NET)
- Request for VB.NET 2005 and ASP.NET Tutorials (IT Professionals' Lounge)
- Shrinking controls in vb.net 2005 (VB.NET)
- Updating Access Db Using Vb.net 2005 (VB.NET)
- How to deal with integer overflow (C)
- Constant MSRPC SrvSvc NetApi Buffer Overflow (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: error printing
- Next Thread: How do i use LibUSB-win32
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add advanced application array assignment basic binary box button buttons center click code combo connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall folder image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity pan peertopeervideostreaming picturebox picturebox2 port print printpreview read record regex reports" reuse right-to-left save savedialog search serial socket sorting sqldatbase storedprocedure string temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf xml





