I am trying to document all major exceptions that can be caused due to use (or misuse) of IntPtr. I tried to search for it, but I am not sure about any other than the OverflowException. This is for interface documentation.

Can someone provide a link or possibly state the main exceptions that can be caused due to the use of IntPtr?

Please let me know if this question does not belong here. I was not sure where to put it.

有帮助吗?

解决方案

Other than OverFlowException there is an other one ArgumentNullException which may be raised against. IntPtr.ISerializable.GetObjectData Method.

From the documentation on MSDN it seems that the OverflowException may occur against.

  1. IntPtr Constructor (Int64)
  2. IntPtr Explicit Conversion (IntPtr to Int32)
  3. IntPtr Explicit Conversion (Int64 to IntPtr)
  4. IntPtr.ToInt32 Method
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top