我想写一篇 void* 缓冲到 MemoryStream 在C++/CLI中。因为我不认为这是直接可能的,或者我想把这个缓冲区转换成 array<byte>^ 为了能打电话 Stream.Write() Marshal 空的* 到 System::IntPtr . 如有任何帮助,我们将不胜感激。
void*
MemoryStream
array<byte>^
Stream.Write()
Marshal
空的*
System::IntPtr
我无法将void*转换为System::IntPtr。如有任何帮助,我们将不胜感激。
你可以使用 IntPtr constructor which takes a void*
void* voidPointer = GetTheVoidPointer(); System::IntPtr intPointer(voidPointer);