Calling C# from C++, Reverse P/Invoke, Mixed Mode DLLs and C++/CLI

前端 未结 3 448
故里飘歌
故里飘歌 2020-12-08 08:22

As I understand it I can use reverse P/Invoke to call C# from C++. Reverse P/Invoke is simply a case of:

  1. Create you managed (c#) class.
  2. Create a c++/
3条回答
  •  我在风中等你
    2020-12-08 08:41

    Here are the answers to the best of my knowledge:

    1. Yes
    2. Yes, it is a mixed mode DLL (In fact, you can make one file of your native C++ project managed and create this C++/CLI class in that file and call the code directly from that file. You don't even need a separate DLL to accomplish this.
    3. C++/CLI and Managed C++ both represent same thing. The only difference is that in the older version till Visual Studio 2003, it was termed as Managed C++. Later on, the syntax was changed quite a lot and it was renamed as C++/CLI. Have a look at this link for details.
    4. Yes
    5. CLR will be used whenever a call to the managed DLL is made.

提交回复
热议问题