I want to execute a method from cpp class in my Windows 10 C# Universal app. As i'm a newbie in Windows app development and C#, so i can use some code to understand the method.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You need to:
1- Create a new Windows Universal Runtime Component DLL, using C++/CX
2- Add a new ref class to it. This class will be a wrapper to your C++ code.
3- Call your C++ method from that new class
4- Add a reference to the new DLL from your C# project, and use the C++/CX wrapper class from there.