WPF: Intermodulation of C# and C++ programs

1. You can create a C++ MFC project to call WPF window elements for display. The MFC project is used as the host project, and the WPF is compiled as a dll.

Link: https://blog.csdn.net/muzizongheng/article/details/5565170

 

2. You can build WPF as the host project writing interface, encapsulate the classes in the C++ project into managed C++ classes, and then compile them into dll. Then include the compiled dll into the WPF project and call it directly as WPF managed code.

Using [dll.name]; directly in the code [class in dll]variable = new [class in dll];

Link: http://blog.51cto.com/joeyliu/1297961

 

3. You can build WPF as the host project, and compile the classes or function sets in the C++ project into dll. WPF calls native C++ functions and classes as pointers.

[Dllimport(mynative.dll)] auto function(…){…}

Link: http://blog.51cto.com/joeyliu/1289614

 

4. Type conversion in C# and C++

Link: https://dotblogs.com.tw/merlin/archive/2012/07/17/73424.aspx

 

5. Creating Windows Runtime Components in C++

Link:

https://docs.microsoft.com/en-us/previous-versions/windows/apps/hh441569(v=vs.140)

http://www.cnblogs.com/Chase/archive/2010/05/31/1748596.html


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325562817&siteId=291194637