Developing for Windows 10 with Visual C++ 2015

Adam Welch (MSFT)

Getting Started

Windows 10 introduces the new Universal Windows App platform, which allows a single codebase to be reused across multiple Windows 10 devices.  An earlier blog post described the pre-release process of getting setup and some of the new features available in Universal Windows Apps.  Now that Windows 10 RTM has released, the following steps will help you get your machine set up to develop Windows 10 apps using Visual Studio 2015 RTM.  

  1. Install the official Windows 10 release , or install the Windows 10 SDK and Windows 10 Mobile Emulator if developing from an earlier version of Windows.
  2. Install Visual Studio 2015 RTM.  If you installed before today, you can run the Visual Studio installer and there will now be an option to install Windows 10 Development Tools.
  3. Create a Universal Windows App:

Image 7041 1

Project Properties for Selecting the SDK Version in Store Apps

A couple new concepts have been introduced to the VC++ project system to allow you to select which version of Windows SDK you are targeting for your apps.  There are two new project properties related to targeting the Windows 10 SDK inside VS2015:

Image 8715 2

Target Platform Version is the actual SDK version that will be actually be referenced in your app.  When a new Windows 10 SDK version becomes available and you install it, this property will allow you to move to that version.

Target Platform Minimum Version is an additional property used only for Store projects that is simply way of indicating in the project file what the lowest supported Windows SDK version that their app will run on.  This mean that feature X that shipped in SDK 10240.1 requires 10240.1 [TPMinV] at a minimum, but can be used from a later SDK version such as 10240.2 [TPV] since that version also supports the feature).  

Note: Visual Studio will not actually enforce this value during a build.  We have exposed it in the IDE for consistency with other languages and to allow developers to declare a guideline for the minimum allowed API surface for the devices they are targeting.

Methods of Retargeting the SDK

As shown above, the project property pages allow toggling the SDK version.  We have introduced two additional ways of retargeting the Windows SDK outside of the project property pages. An SDK retargeting dialog can be launched by either right-clicking the project and selecting “Retarget SDK” (retarget SDK per project), or right-clicking the solution and selecting “Retarget solution”.  Since some solutions may contain many projects, the solution-level gesture allows the SDK retargeting to be performed in a single step for the entire app.

Image 3005 3

When the dialog is invoked from the solution, all projects will be listed and the desired Target Platform Version and Target Platform Minimum Version can be selected for those projects:

Image 3630 4

Porting Windows 8.1 Store and Window Phone 8.1 Apps to Universal Windows Apps

Upgrading an existing Store app to the Universal Windows App platform must be done manually inside Visual Studio.  The following resources provide the necessary information:

Move from Windows Runtime 8 to UWP

Update your UWP Microsoft Visual Studio 2015 RC project to RTM

SDK Targeting for Windows Desktop Development

For Windows Desktop apps, the default Windows SDK for VS2015 RTM is the Windows 8.1 SDK.  Similar to Universal Windows apps, Windows Desktop apps also support the notion of Target Platform Version which can be used to change which Windows SDK is being targeted.  Creating a new Desktop project will have the Target Platform Version set to 8.1.  If later versions of the Windows SDK are installed on disk (like Windows 10 RTM: 10240.0), these will also be selectable in the Target Platform Version dropdown:

Image 6014 5

Note: When targeting Windows XP, set the Platform Toolset to v140_xp as was done in previous Visual Studio releases.

Image 7711 6

Thanks,
Adam Welch
Visual C++ Team

Posted in C++

0 comments

Discussion is closed.

Feedback usabilla icon