c++ cli - Wrapper to unmanaged code -
how build wrapper unmanaged code in order use in managed code, , when have that?
you don't need wrapper, many dlls straight-forward exported c functions can pinvoked [dllimport] attribute. exception c exports poorly designed dll requires client code release memory, can't done managed code since doesn't have access allocator.
the case have have wrapper native c++ class. managed code cannot pinvoke directly since doesn't know how create instance of class (which requires knowing size of object , calling constructor) nor how destroy (which requires calling destructor). pretty easy in c++/cli. mechanical, swig project can automatically. learning tool more of investment learning how write wrapper.
Comments
Post a Comment