<sc*****@gmail.comwrote in message
news:11*********************@l39g2000cwd.googlegro ups.com...
MyFunction()
Expects a pointer to be passed pointing to the buffer.
As Vadym stated:
>byte[] bmp = new byte[size];
MyFunction(bmp);
Will solve your problem based on all that you have told us.
Replace
BYTE* pbmp = (BYTE*)malloc(lSize);;
with
byte[] bmp = new byte[size];
// pbmp is a pointer to a dynamically allocated block of memory of size:
lSize
// bmp is a reference (think pointer) to a dynamically allocated array
of bytes of size: size
It is possible that you actually NEED to use pointers for your real
problem (they do exist in C#)
But, from what you have shown us....you have your solution.
Bill