Hey Doug,
1/ You can try to pin the memory. For instance if you have a byte[], you can
pin it so it doesn't get moved around in memory.
2/ Alternatively you can use the GCHandle class to pin the memory.
3/ You could use AllocCoTaskMem & FreeCoTaskMem methods in the Marshal class
(but I've never tried).
4/ Use another way to allocate memory than .NET memory manager. For
instance, link to VirtualAlloc and VirtualFree in kernel32.dll
5/ Have your C++ component give a pointer to a memory block which can be
filled by the C# component.
HTH,
Tom Tempelaere.
"Doug Taylor" wrote:
Hi. I'm new here and I don't think I'm in Kansas anymore...
What's the best / most efficient way to marshal a buffer of pixel
data from a C# COM object up to a C++ application? Anybody got a
"short but complete program" to illustrate it?