In the examples for Btrieve Classes for .NET they use the marshal functions StructureToPtr and PtrToFunction, which I think copy back and forth from managed to unmanaged memory. With the GCHandle functions you can "pin" the structure in the unmanaged heap, which sounds better since the return buffer is reused often.
I get the impression y'all program mostly in C++ and Java, so I may be barking up the wrong tree, but I've hit a wall of fog trying to google this. If you could give me any insight into the best approach among the options I would be very obliged. I think I am getting memory corruption from improper marshalling.
Mike