This topic discusses how you can:
Open an SDK Sample Within Visual C++
Build an SDK Sample from the Command Line
Fix an SDK Sample that Fails to Build
There are two ways you can open an SDK sample project in Visual C++: by using the .dsp file or by using the MAKEFILE. If an SDK sample does not have a .sdp file, then it will have a MAKEFILE.
Note Some SDK samples contain version 5.0 Visual C++ .dsp and .dsw files. These project and workspace files can be used in Visual C++ 6.0. However, when you open the file, you will be prompted to confirm its conversion to the Visual C++ 6.0 format. Also note that some samples will generate warnings when you build the project.
To open a sample in the development environment using the .dsp file
When you open a .dsp file for a sample that also has a .dsw file, Visual C++ will attempt to open the .dsw file.
To open a sample in the development environment using MAKEFILE
For more information on NMAKE and the commands in a MAKEFILE, see the NMAKE Reference.
Each SDK sample comes with a MAKEFILE. MAKEFILEs are designed to run at the command prompt. See Open an SDK Sample Within Visual C++ for information on how to build a project's MAKEFILE from the development environment.
To build a sample from a command line in a command prompt window
If you encounter an error when you build an SDK sample at the command line or from with Visual C++, a possible cause is that all the files necessary for building the sample are not present. Inspect the sample's MAKEFILE for any file dependencies and then check your drive to ensure that all the required files and subdirectories are present. For example, if there are more than one download link in a sample abstract, you must not change the download path, which displays when you click a download link, beginning with the sdk subdirectory.
If you determine that one or more files or directories are not on your local machine, you will need to copy the files from the MSDN CD that holds the Visual C++ samples.