How can I convert an unmanaged IntPtr type to a c# string?

前端 未结 2 1476
广开言路
广开言路 2020-12-11 00:37

I\'m new to C# (from a native C++ background) and I\'m trying to write a little UI to print windows broadcast messages among other things. I\'ve overridden the default WndP

2条回答
  •  误落风尘
    2020-12-11 01:15

    Marshal.PtrToStringAuto Method (IntPtr)

    Allocates a managed String and copies all characters up to the first null character from a string stored in unmanaged memory into it.

提交回复
热议问题