i'm wrapping an unmanaged C++ API in a COM library (using ATL), so i can more easily do interop with C#.
one of the APIs i'm wrapping uses a C++ data structure containing an unsigned char* field. I'm looking for the best way to pass this back to .NET. I've gotten it working using a SAFEARRAY, constructed in the ATL DLL, and returned as an Array to .NET, but this entails two extra buffer copies (one into the SAFEARRAY, and one into an unmanaged buffer in .NET for constructing a Bitmap class). Is there an easy way to expose the unmanaged 'unsigned char*' pointer from the ATL DLL (as an IntPtr), so I can use it directly in the Bitmap class constructor? thanks for any help, Kirk -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Kirk Marple Chief Software Architect, VP of Engineering Agnostic Media, Inc. e: [EMAIL PROTECTED] w: www.agnostic-media.com blog: http://sqljunkies.com/WebLog/kmarple You can get my Digital ID here: https://digitalid.verisign.com/services/client/index.html =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com