Build Windows 8 Apps with Microsoft Visual C++ Step by Step
Luca Regnicoli
Paolo Pialorsi
Roberto Brunetti
Published by Microsoft Press
This book is dedicated to Barbara.
ROBERTO BRUNETTI
This book is dedicated to my parents. Thanks!
PAOLO PIALORSI
This book is dedicated to my mother, Vanna, the strongest woman I have ever known.
LUCA REGNICOLI
Special Upgrade Offer
If you purchased this ebook directly from oreilly.com, you have the following benefits:
DRM-free ebooksuse your ebooks across devices without restrictions or limitations
Multiple formatsuse on your laptop, tablet, or phone
Lifetime access, with free updates
Dropbox syncingyour files, anywhere
If you purchased this ebook from another retailer, you can upgrade your ebook to take advantage of all these benefits for just $4.99. to access your ebook upgrade.
Please note that upgrade offers are not available from sample content.
A Note Regarding Supplemental Files
Supplemental files and examples for this book can be found at http://examples.oreilly.com/9780735667235-files/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Introduction
Windows 8 is Microsofts newest operating system, intended to let developers fluent in various programming languagessuch as C++, C#, or JavaScriptleverage its powerful infrastructure to build applications using a brand-new library called the Windows Runtime API.
This book provides an organized walk-through of the features, APIs, and user experience in Windows 8. The content is introductory it discusses each component from a theoretical viewpoint interspersed with basic but effective code samples, which you can follow to get a jump-start in developing for the Windows 8 platform.
The book provides coverage of almost all the main Windows 8 aspects and features, and it offers essential guidance in learning them using the classic Step by Step approach.
In addition to its coverage of core Windows 8 features using C++, the book discusses some related aspects, such as Windows Communication Foundation (WCF) Data Services, Open Data Protocol (OData), ADO.NET Entity Framework, and applications architecture. Beyond the explanatory content, each chapter includes a rich set of step-by-step examples, as well as downloadable sample projects that you can explore for yourself.
Who should read this book
This goal of this book is to provide experienced C++ developers with the information they need to begin working with the main components of the Windows 8 operating system and the Windows Runtime. Starting with the Windows Runtime APIs, the book moves readers through a comprehensive discussion of the new user experience, including how to design interfaces that work for the keyboard, the mouse, and touch screens. This book does not teach C++; readers need a solid knowledge of the C++ language to fully understand the code presented in the book and to follow along by performing the exercises using Microsoft Visual Studio 2012. This book is also useful for software architects conversant with C++ who need an overview of the components they would plan to include in the overall architecture of a real-world Windows 8 solution.
Who should not read this book
If you have worked with Windows 8 already, this book is probably not for you. It is an introductory guide to developing applications that leverage the platform using C++.
Assumptions
To get the most out of this book, you should have at least a minimal understanding of C++ development and object-oriented programming concepts. Although you can also develop for Windows 8 using any .NET language or JavaScript, this book includes examples in C++ only.
In addition to the C++ language, the examples in , assume you have a basic understanding of ASP.NET and WCF, although the code presented for those examples doesnt use any advanced features of either technology.
Organization of this book
This book is divided into 10 chapters, each of which focuses on a different aspect or technology within the Windows 8 operating system and Windows Runtime APIs.
Finding your best starting point in this book
We suggest that you start reading the book from the beginning. By following this path, you will discover all of the aspects of the new look and feel, the new user experience, and the new user interface for touch-based devices required for building successful Windows 8 applications. , is the fundamental starting point for building your first Windows 8 application. Use the following table to determine how best to proceed through the book.
If you are | Follow these steps |
New to Windows 8 development | Start with . |
New to Windows 8 UI style | Start with . |
Not new to Windows 8 development using the provided templates | Start with . |
A XAML developer | Start with to gain a solid understanding of the controls specific to Windows 8 apps and how to design flexible layouts. |
Most of the books chapters include hands-on procedures and examples that let you try out the concepts discussed in each chapter. No matter which sections you choose to focus on, be sure to download the companion code from the publishers site (see the Code samples section of this introduction), and install them on your system.
Conventions and features in this book
This book presents information using conventions designed to make the information readable and easy to follow.
Each exercise consists of a series of tasks, presented as numbered steps (1, 2, and so on) listing each action you must take to complete the exercise.
Boxed elements with labels such as Note provide additional information or alternative methods for completing a step successfully.
Text that you type (apart from code blocks) appears in bold.
A plus sign (+) between two key names means that you must press those keys at the same time. For example, Press Alt+Tab means that you hold down the Alt key while you press the Tab key.
A vertical bar between two or more menu items (for example, File | Close), means that you should select the first menu or menu item, then the next, and so on.
System Requirements
You will need the following hardware and software to complete the practice exercises in this book:
Windows 8 installed
Visual Studio 2012, any edition tailored for Windows 8 (the Express edition for Windows 8 is free)
Computer with a 1.6 GHz or faster processor
1 GB of RAM (1.5 GB if running on a virtual machine)
10 GB (NTFS) of available hard disk space
5400 RPM (or faster) hard disk drive
DirectX 9-capable video card running at 1024 768 or higher display resolution