I have been reading up on IntPtr and have read that it is used to represent a Handle(s). What does this mean exactly? I’m sure it is a simple explanation, but the light bulb is just not turning on at the moment..
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is typically referring to an operating system Handle, and used internally. For example, Windows Forms uses an
IntPtrto refer to the Control’s native Window Handle (HWND).Handles in the Windows API are used for many things – most operating system related resources (files, sockets, windows, etc) are all exposed through a handle, which is effectively a pointer. In managed code, this gets stored in an
IntPtr.That being said,
IntPtris also regularly used to store pointers in interop scenarios, as well, as it automatically resizes based on 32bit or 64bit code.