intptr
Is default(IntPtr) legal in an extern function?
Let\'s say I have the following signature: static extern void External(int foo, IntPtr bar); I want to make it use defaults:[详细]
2023-02-03 23:10 分类:问答Which is better/safer to use: HandleRef or IntPtr (newer source code from Microsoft no longer uses HandleRef)
For example, in the old .NET Framework 2.0 Source Code (Windows Forms, Visual Studio 2005 - Whidbey), the GetC开发者_如何转开发lientRect function was defined using HandleRef:[详细]
2023-01-27 19:49 分类:问答The new IntPtr.Add method - am I missing the point of the int?
Starting from FW 4.0, the IntPtr structure has the Add method: public static IntPtr Add( IntPtr pointer,[详细]
2023-01-26 22:57 分类:问答C# calling C++ method that returns a pointer. Explain memory management
Can someone explain what exactly is happening at a low level / memory management perspective on the 2 C# lines in \"Main\" in the following?[详细]
2023-01-21 22:22 分类:问答IntPtr To String conversion in Windows messages
I\'m getting in trouble by hooking window messages. I need to detect window text (caption) changes, so I intercept the WM_SETTEXT message for the interesting windows (I do so because at window creatio[详细]
2023-01-12 16:43 分类:问答Serialize an IntPtr using XmlSerializer
I\'m wondering why the IntPtr type is not supported by the XmlSerializer implementation. When I try to serialize a class including a field of IntPtr type, the serialization fails telling me that IntPt[详细]
2023-01-11 03:20 分类:问答IntPtr and avoiding unsafe code
I have an external library that takes an IntPtr.Is there any safe way to do this... int BytesWritten = 0;[详细]
2023-01-08 18:02 分类:问答How to marshal int* in C#?
I would like to call this method in unmanaged library: void __stdcall GetConstraints( unsigned int* puiMaxWidth,[详细]
2022-12-28 07:21 分类:问答How to declare a IntPtr?
I have a Window handle Picker and it says my handle is 0094167C. When I declare the variable in c# the letter in th开发者_JAVA技巧is code gives an error.[详细]
2022-12-23 02:44 分类:问答PostMessage unable to pass a string C#
Here is my prototype: [DllImport(\"user32.dll\", CharSet = CharSet.Auto)] public static extern bool PostMessage(int hhwnd, uint msg, IntPtr wparam, IntPtr lparam);[详细]
2022-12-17 12:26 分类:问答