How can avoid at this line an OverflowException?
- by SoMoS
LastInput.time is an Integer and m_idleTime is an Integer too. This line sometimes generates an Overflow exception, I think that this happens when both values are big negative values.
(Environment.TickCount - lastInput.time) > m_idleTime
How can I avoid that? With casting?
(CType(Environment.TickCount,Long) - CType(lastInput.time,Long)) > m_idleTime
Or maybe with this cast?
CType((Environment.TickCount - lastInput.time),Long) > m_idleTime
Thanks in advance.