How to fix: "OverflowException occurred Arithmetic operation resulted in an overflow"
Revision 2
My C# (asp) code is :
int real_buffer_size=0;
int BufferSize = 100*CMIB_TCPEXROW.size_ex+4;
IntPtr lpTable = Marshal.AllocHGlobal(BufferSize);
}
Error Line==> Int32 NumEntries= (int)Marshal.ReadIntPtr(lpTable);
real_buffer_size=NumEntries*CMIB_TCPEXROW.size_ex+4;
if (BufferSize<real_buffer_size)
{
Marshal.FreeHGlobal(lpTable);
BufferSize = real_buffer_size;
lpTable = Marshal.AllocHGlobal(BufferSize);
when I run my C# code (ASP) it stop with error :
Quote:
OverflowException occurred
Arithmetic operation resulted in an overflow.
in line:
Int32 NumEntries= (int)Marshal.ReadIntPtr(lpTable);
I know what the Error mean, but I do not know how to resolve it! which changes should I make to fix this error? (for example, which parameter should I change?)
Your Help will be Appreciated,
Posted 16-Jan-13 4:43am
by
keshtkar2.