C# library to native C++ application

前端 未结 3 1076
说谎
说谎 2021-01-24 02:00

I know I can use dll import + wrapping (managed) to use C++ libraries in C# applications (question link>>) but what\'s opposite? How can I use C# library in my C++ application?

3条回答
  •  感情败类
    2021-01-24 02:55

    You will have to take care to expose your interface from the C# library to a C++-compatible layer.

    Out of the top of my head, you could do two things:

    • Create a C API on top of your C# library (best way would be to add a C++/CLI layer to your library).

    • Create a COM interface to your C# library and use the library through COM objects.

提交回复
热议问题