 Hello, my name is Raman Sharma and I'm a program manager with the Visual C++ team here at Microsoft. In this video, I'm going to talk briefly about some of the work we have done in Visual Studio 2015 to enable building C++ apps for Windows 10. This is the agenda for today. I'll provide an overview of some of the new concept that Windows 10 introduces for developers and how C++ interacts with these features. Then we're going to look at a quick demo of some of these features followed by some useful links to resources about Windows 10 development. Now, one very important thing Windows 10 enables for developers is this concept of universal apps, which means building your apps once and running them on multiple devices like desktops, tablets, phones, Xbox, and even beyond that. This concept existed even for Windows 8.1 and Windows Phone 8.1 apps, but in a slightly different form. Windows 10 goes a step further and enables creation of universal apps at a common binary level, which means that API surface of Windows 10 has converged enough across multiple device types to allow for creation of a single binary that will run on multiple devices. Now, since this is native code we are talking about, the common binary really means one binary per architecture, which is a huge improvement from the past. Another new concept Windows 10 introduces is this notion of API contracts for Windows Runtime API. If you have done any .NET programming, you might be already familiar with this concept. The idea really is that when you're building an app, instead of specifying a hard dependency on a specific API, you specify a dependency on a bundle of functionality called an API contract. Windows 10 allows your app to declare what all API contracts it needs and it can then use this information to determine which all devices your apps can run on. In addition to this, API contracts also allow you to check for the presence of some device capability at runtime and dynamically change the app's behavior at runtime based on this information. And lastly, in addition to all the Windows 10 specific changes, Visual C++ also provides several new features in the C++ language and libraries conform in space. We have done a lot of work to provide major pieces of the C++ 11 and C++ 14 standards. By adding these features, we allow our customers to write cross-platform C++ code that can be built with any conforming compiler on any platform. This also expands the list of cross-platform open source libraries that are commonly used for other mobile platforms like iOS and Android and can now easily be used in Windows apps. Now let's jump into the demo and look at a product in the action. So here I have Visual Studio 2015 running on a Windows 10 machine. Let us go ahead and create a Universal C++ app project. If you go to File, New, Project, you'll see that under Visual C++, Windows, Windows Universal, there are a number of project templates for XAML, for DirectX, for DLLs, static libraries, Windows runtime components, and so on. For now, I'll just go ahead and create a blank XAML C++ app. Once the project has been loaded inside the IDE, you will notice that there are a few things that are new for Windows 10 Universal apps. So in the solution explorer, if you look under the references, you see these new things called API contracts. Now from a developer's perspective, these API contracts are nothing but Windows metadata files which live somewhere inside the Windows SDK. Windows 10 exposes a number of API contracts. However, these three are a part of the Universal app platform which means that they are always present on any device, which means that every time you create a Universal app project using Visual Studio, these API contracts are always added to your project. At build time, these API contracts are passed along to the C++ compiler. The compiler understands the format of these contract WinMD files and allows the user to call any API specified inside these WinMD files. The second new thing is inside this file called package.appxmanifest. So this file is basically what determines the shape and the target of your application package. So if you notice, there's a new thing here called target device family. What this is saying is that your app package can target any device which is a part of the Windows.Universal target device family, which means the same app package can be installed and run on Xbox, desktop, as well as mobile apps. So let us close these files and go ahead and write some simple XAML code by opening up the main page.xaml file. So in this file, let us go ahead and add some simple XAML code. So this code, what it does is it just brings up a text block in the center of the window and we'll see how this text block appears both on desktop as well as a mobile emulator. So let us go ahead and save this file. Now, I know that I can write the same UI which appears in a device-appropriate fashion for both desktop as well as mobile device. But what if I want to write some code inside my app so that my app does something specific while working on a mobile device? How do I do that? So the first step to do that is by adding a reference. You add a reference to something called Microsoft Mobile Extension SDK for Universal Apps. And once you do that, you'll notice that under the References node, a whole new set of API contracts now show up. All of these are phone-specific API contracts which allow your app to call into some phone-specific functionality. Now you can open up your code file which is the main page.xaml.cpp file and you can directly write some code to call some phone-specific API. But at the same time, you still want to make sure that your app continues to do the right thing when it is running on a desktop. So how do you do that? You do that by using a new functionality introduced in Windows 10 called Runtime API Checks. Let's see how to do that. So I'll again copy some simple code in the constructor of the main page. So what this code essentially does, it's calling a new API called API Information and it's checking for the presence of a type called Hardware Buttons in the Runtime target. And depending on whether Hardware Buttons are present or not, we'll go ahead and add an event handler to the camera-pressed event inside the Harvey Buttons. So let's go ahead and do that. So this is the event that I want to add an event handler to. Now adding an event handler inside the IDE is actually very simple. All you need to do is hit Tab twice and it goes ahead and actually even creates a dummy implementation for the event handler. So I don't want a dummy implementation, so I delete this code and instead I write some simple code again to throw up a message dialog every time the button is hit. So that's it. Let's go ahead and build the app. Once the app is built, let us launch the app on the local machine. So the app actually launches on the local machine and you see that Windows 10, the text is centered inside the window. The one different thing you'll notice here is that this is not a full-screen app, which is a new thing in Windows 10 for universal apps running on desktop devices. So let's close this and instead of running on the local machine, let us launch on a mobile emulator this time. Select the mobile emulator and hit Run. So you'll notice that Visual Studio did not have to rebuild the app. It basically takes the same set of binaries and deploys them to the phone emulator and launches the app. You'll see that here, Windows 10, the text actually appears in the center of the window, but in a full-screen window because that is what makes sense on a mobile device. Additionally, if I go ahead and press this hardware button, which is present on the mobile emulator itself, you'll see the message box called camera pressed pops up. So that was a really quick overview of the new features. There is much more to the story and here are some useful resources if you want to learn more about Windows 10 developer experience or Visual C++ in general. There is the Visual C++ blog where we blog about all the work that C++ team does. Building apps for Windows blog is where you'll find useful information about Windows developer experience. The last one is the link to the Windows Insider program through which you can find out how to get quick access to early builds of both Windows 10 and the associated developer tools. That's all we have for today. We hope you will like these new features. We look forward to your feedback. Thanks for watching.