Latest versions of Visual Studio come with few or no source code project samples. However, there are hundreds available on Microsoft sites. Here is how to get them.
Install samples using Visual Studio 2012 or 2013
For getting samples from Visual Studio IDE, follow next steps:
- On the Help menu, click Samples.
Get Visual C++ samples – step 1 If you have Visual Studio 2012 or Visual Studio 2013, the New Project dialog is open.
- Expand left-pane tree to the desired category, e.g Visual C++ / Desktop / Win32 / Graphics and 3D, select a sample project from the list, them click the OK button.
- In the Download and Install dialog, click on Install button.
Now, the sample project is added to the installed samples list, which are available each time you want to have a look inside.

Additionally, each time when open an installed sample project, Visual Studio shows a page containing the sample description, a link to download page, plus links to useful resources and tutorials. That’s pretty cool but notice that Visual Studio gets only the samples written for its own version. To get access to all samples, see the next method.
Download Visual C++ samples from MSDN Developer Code Samples
Here is the magic link: http://code.msdn.microsoft.com/
Click it here or type in a browser and get the main Developer Code Samples page. You can filter the articles according to your interests (programming language: C++, platform: Desktop and so on). Moreover, you can type a keyword to refine the filter (e.g. Direct2D) like in the below picture.

All to do next is to click on desired link and download.
Notes
- If click Help / Samples in a version prior to 2012, Viusal Studio shows a page containing a link to Visual Studio Samples site.
Visual Studio 2010 Samples
See also
- Codexpert: How to Get Visual C++ Sample Projects (2)
Resources
- Visual C++ Samples (Visual Studio 2010)
- Visual C++ Samples (Visual Studio 2012)
- Visual C++ Samples (Visual Studio 2013)
Downloads
- MSDN: Developer code samples