Getting Started with Visual Studio

Kinect for Windows 1.5, 1.6, 1.7, 1.8

To work with the samples or develop your own applications, use Visual Studio 2010 Express (which is available at no cost) or any other version of Visual Studio 2010. A Visual Studio 2010 edition is required.

Prerequisites for Developers

Developers should be familiar with the following development environment and languages to take advantage of the SDK features.

Visual Studio 2010 or Visual Studio 2012

To work with the SDK and to develop your own applications with the SDK, you can use Visual Studio 2010 or Visual Studio 2012, including the Express editions. Visual Studio Express is available at no cost from the Microsoft website. If you are new to Visual Studio, see the Visual Studio 2010 Getting Started Guide, or the Visual Studio 2012 Getting Started Guide.

C# or C++ or VB languages

Samples are available in C#, C++, and Visual Basic. For information about programming in these languages, see Visual Studio C# Developer Center, Visual Studio C++ Developer Center, and the Visual Basic Developer Center.

Application development for Windows 7 and Windows 8.

The SDK has a minimum dependency of Windows 7 and is supported on Windows 8 as well. If you are new to Windows development, see The Beginner Developer Learning Center on MSDN.

Installing Visual Studio 2010 Express or Visual Studio 2012 Express

Follow this procedure to install Visual Studio 2010 Express or Visual Studio 2012 Express.

To install Visual Studio 2010 Express or Visual Studio 2012 Express

  1. From the following web page, install Visual Studio 2010 Express for either C++ or C#: Visual Studio 2010 Express Products. For Visual Studio 2012 Express for either C++ or C#, see Visual Studio 2012 Express.

  2. After the installation completes, check for updates on Windows Update. Install any relevant updates and restart your computer if you are prompted to do so.

  3. The first time you start Visual Studio Express, the program prompts you for a registration code. To get the code, follow the instructions on the screen or see the following website: Installing and Registering Visual Studio Express Editions.

    You need a Windows Live ID to register. If you use Messenger, Hotmail, or Xbox Live, you already have a Windows Live ID. If not, you can sign up at the following website: Create your Windows Live ID.

Use the following links to review introductory information on MSDN:

For introductory material on Visual C++ Express Edition, see:

For introductory material on Visual C# Express Edition, see:

Configuring the Development Environment

Visual Studio Express Edition for either C++ or C# includes an integrated development environment (IDE) for coding, debugging, and testing your application. This section provides notes for configuring your development environment to work with the SDK.

Use the SDK to target either 32 or 64 bit applications. The SDK includes Kinect for Windows drivers as well as libraries for x86 and x64 systems.

If you install Visual Studio Express in the default location and accept its defaults for project files, the default locations for source, header, and library files will also be correct. However, in some cases you might need to add folders to the defaults.

To change default file locations

  1. Start Visual Studio Express from the Start menu.

  2. Click File, click Open, and then click Project/Solution. Navigate to the folder that contains the solution file for the sample or application.

  3. If the Project menu is not visible, press F7 to try to build the solution. When you build the solution, Visual Studio Express displays the Project menu.

  4. On the Project menu, click Properties.

  5. In the left column of the property page, click Configuration Properties and then VC++ Directories (or VC# Directories, depending on your installation) to see a list of the locations that the development environment searches for files.

  6. Click the item to change, and then click the drop-down arrow on the far right to edit the locations.


Creating a Project in Visual Studio

In Visual Studio, organize your development work into projects and solutions.

To create your first project in Visual Studio

  1. Follow the steps for How to: Create Solutions and Projects.

  2. To add files to your project, follow the steps in How to: Add and Remove Solution Items. The development environments for Visual Studio and Visual Studio Express are similar but some menus are organized differently because full Visual Studio provides more extensive capabilities. In particular, Visual Studio Express does not have a Build menu; instead, find the Build Solution command on the Debug menu.

To Create a Managed Application

Follow these steps to create a managed application.

To create a C# application

  1. Reference Microsoft.Kinect.dll. This assembly is in the global assembly cache (GAC) and appears on the .NET tab of the Add Reference dialog box. This DLL calls unmanaged functions from managed code.

  2. Include using directives for the following namespace:

                using Microsoft.Kinect;

To Create an Unmanaged Application

Follow these steps to implement an unmanaged application.

To implement a C++ application

  1. Include <NuiApi.h> in your source code.

                    #include <NuiApi.h>
  2. For standard definitions, include windows.h and ole2.h in your source code.
  3. To use the NUI API, include NuiApi.h, which is in %KINECTSDK10_DIR%\inc. NuiApi.h includes NuiCamera.h and NuiSkeleton.h also.
  4. To use the Kinect Audio API, include NuiSensor.h, which is in %KINECTSDK10_DIR%\inc.
  5. Link to Kinect10.lib, which is in %KINECTSDK10_DIR%\lib\x86 (for 32-bit apps) or %KINECTSDK10_DIR%\lib\amd64 (for 64-bit apps).
  6. If you are using player index information, specify both NUI_INITIALIZE_FLAG_USES_DEPTH_AND_PLAYER_INDEX and NUI_INITIALIZE_FLAG_USES_SKELETON in the dwFlags parameter to NuiInitialize.
  7. The C++ header files are installed in the path contained in the environment variable: KINECTSDK10_DIR, and include the following files:

    • NuiApi.h - Aggregates all NUI API headers and defines basic initialization and access functions. Use these functions to enumerate devices and access multiple devices. This is the main header file to include in your C++ project; this file includes NuiImageCamera.h and NuiSkeleton.h.
    • NuiImageCamera.h - APIs for image and camera services for adjusting camera settings and opening reading data streams.
    • NuiSkeleton.h - APIs to enable skeleton tracking, get skeleton data, and transform skeleton data for smoother rendering.
    • NuiSensor.h - Audio APIs including the ISoundSourceLocalizer interface, which supports beamforming and source localization.

Community Additions