Brett wrote:
Whats the best option for us (ie. minimum work) to provide him with
an API that he can use in his own applications? I was originally
considering a COM interface, but looking into .NET, I'm wondering if
we should just upgrade the appropriate sections of code to "managed
code" so he can use that from one of his languages. Is this a big and
difficult job in peoples experience?
I assume you mean by using managed C++ to create wrapper classes. It's
not too difficult to do. Don't just compile your C++ with /clr because
that will make all the code compile to IL, except for code that won't
convert, in which case you'll have managed-unmanaged transitions. Its
better to compile your unmanaged code to a static lib, or a DLL and use
a simple wrapper class. That way you'll know that all of your library
will run as native code (as you intended and tested) and the
managed-unmanaged transitions will be where you expect them - in the
wrapper class.
Be aware of callback functions, because they will give another
managed-unmanaged transitions. You might want to pass large buffers into
your unmanaged code, in this case you can use the allocators in the
Marshal class; you could use .NET arrays, but in that case you'll have
to pin the array and that gets messy.
Richard
--
www.richardgrimes.com
my email
ev******@zicf.b et is encrypted with ROT13 (
www.rot13.org)