How can reuse C++ project in C# project ? WinRT Metro App RRS feed

  • Question

  • I have a C++ project and i want to reuse it in my C# project.

    How can do it ?

    Now i'm try to convert C++ project to Window Runtime Component C++. But there are't options in Visual Studio to do it. So i create new Window Runtime Component C++ and copy all source code from C++ project to it. But i can't compile it. It's throw so many exception like : "Cannot open precompiled header file: 'Debug\pch.pch'". I use example code from  https://code.msdn.microsoft.com/windowsapps/Universal-Windows-app-cb3248c3

    Please suggest me some solution to reuse C++ project metro application in C# project metro application.

    Monday, March 23, 2015 12:20 PM

All replies

  • You may be able to reference the .exe directly. I know you can do this with regular .NET, but I haven't tried with a WinRT app.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 23, 2015 10:56 PM
  • Hi Matt

    I can't add reference to .exe

    With error message :

    Instead of I can reference to .winmd but from C# project i can't navigate to a page in C++ project.(Mainpage C# navigate to Mainpage C++)

    Tuesday, March 24, 2015 3:30 AM