Search code examples
c#c++clrpinvokeunmanaged

Convert .lib and .h files to .NET


A brokerage firm has an API built around C++ provided as a library and header files for users to consume(orders, prices, news..etc), long story short, I only have practical knowledge of C# and would like to make use of some wrapping technologies to make use of the .lib and .h files provided by converting them into managed DLLs. Is there a way of doing this without getting involved in much C++ coding/wrapping?


Solution

  • You can use C++/CLI. Try to starts from here. Basically I would create a C++/CLI wrapper in order to expose a wise set of functionality to c#. Anyway, it is not an easy task. An alternative is to write in pure c++ some extern "C" entry point to the library and access that api using P/Invoke.