C++ Interop: How do I call a C# class from native C++, with the twist the class is non-static?

前端 未结 3 1535
北恋
北恋 2020-12-29 01:04

I have a large application written in native C++. I also have a class in C# that I need to call.

If the C# class was static, then it would be trivial (there\'s lots

3条回答
  •  甜味超标
    2020-12-29 01:26

    Two options come to mind.

    1. Expose the class as a COM object and use it as a COM object from C++.
    2. Create a static C# class that exposes an interface to interact with the non-static C# class.

提交回复
热议问题