Link to home
Start Free TrialLog in
Avatar of jxbma
jxbmaFlag for United States of America

asked on

How do I wrap unmanaged C++ classes so they can be consumed by .Net managed client applications?

Hi:

We have a win32 C++ unmanaged library (which calls Boost and openCV under the covers).
The library contains several public class definitions.
The classes themselves expose several methods who's parameters include vectors, shared pointers
and callbacks as part of their method signatures.

We would like to create a wrapper which would allow these classes to be consumed by .Net (managed) clients.
We want to preserve support for our existing unmanaged client applications. So I guess this will have to be
a separate DLL/library. Another consideration is performance marshaling across the managed/unmanaged
boundary. We'll be pushing byte arrays of images back and forth between the client app and libraries at
the rate of 30-50 times per second.

What is the best approach for doing this?

Can someone point me in the direction of any sample implementations, tutorials, strategies to get us started?
The last time I looked at something like this was well over 10 years ago.
I seem to vaguely remember pInvoke and the IJW works.

Any ideas would be greatly appreciated.

Thanks,
JohnB
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial