I'm calling a method via interop that returns an out IntPtr
parameter. How can I get a byte*
for this IntPtr
so I can operate on it? I tried the following:
fixed(byte* ptr = (byte)myIntPtr)
but it didn't work. Any help would be appreciated!
You can simply write:
byte* ptr = (byte*)int_ptr;
You don't have to use the fixed keyword. You don't want to pin the IntPtr, do you?
myIntPtr.ToPointer()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With