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.
Two options. Great, now that Visual Studio Community is installed, you have two options for developing and running C programs on Windows. The first option involves using any text editor you like to write your source code, and using the "cl" command within the Developer Command Prompt to compile your code.
Step 1: Open turbo C IDE(Integrated Development Environment), click on File and then click on New. Step 2: Write the C program code. Step 3: Click on Compile or press Alt + F9 to compile the code. Step 4: Click on Run or press Ctrl + F9 to run the code.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With