Windows Phone 8 I Can't add c++ Template to pr

2019-06-09 11:06发布

问题:

Let's describe my problem:

I've created a Windows 8 App already, its written in c++/cli and xaml. Now I want to get this App to Windows Phone 8. So my first step is creating a new project:

Then I want to add a new element based on a c++ template but VS just shows me c# templates:

You remember? I created a project based on C++! How can I add new elements based on c++ template like I do in normal Windows 8 SDK?:

Do I have to download those templates somewhere? Is there any other way to get my Xaml pages based on c++ from windows 8 project to windows phone 8 project?

回答1:

Windows Phone 8 doesn't support writing C++/XAML applications, only C++/D3D ones. That's why there are no C++/XAML templates. You can mix XAML and D3D but you'd need to write the XAML UI layer in C# or VB.

See Native code on Windows Phone 8 topic on MSDN for more details. To quote:

Windows Phone 8 doesn’t support the XAML UI with C++ code-behind app model that is supported for Windows Store apps.