Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use Managed C + + wrapper unmanaged C + + class library , for C # to becalled.thanks.
Posted

1 solution

Simply create a managed C++/CLI DLL then create wrapper classes that call the unmanaged code.
 
Share this answer
 
Comments
pucx 14-Oct-11 0:03am    
but how to call the unmanaged code?I don't know.thanks.
Philippe Mori 14-Oct-11 7:58am    
Nothing special to call unmanaged code... Well, if you need to have a unmanaged object inside a ref class, you must have a pointer (or a reference) and not an embedded object and you have to read rules about destructors and finalizer...

There are pragmas to control weither a portion of code is managed or not but generally it does not matters much for the program to works but in some cases, it might help performance.

Also, if you need to keep a handle to a ref class from an unmanaged class, there is the gcroot utility class for that purpose.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900