Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use C++ class in Windows 10 C# universal app? [closed]

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.

like image 224
DeepSidhu1313 Avatar asked Aug 14 '15 17:08

DeepSidhu1313


People also ask

Can you code in C on Windows?

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.

Can we run C program in Turbo C?

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.


1 Answers

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.

like image 195
yms Avatar answered Oct 11 '22 01:10

yms