Building the C++ Samples
The MMC C++ sample snap-ins are installed as part of the Microsoft® Platform SDK. Currently this location has a path similar to the following. Here, it is assumed that D: is the Platform SDK installation drive:

D:\Platform SDK\Samples\SysMgmt\MMC\

To build any of the MMC C++ sample snap-ins, the following environment is required:

•	Microsoft Windows 2000, Windows NT 4.0, or Windows 98 operating system
•	Microsoft Visual C++ 6.0; or properly installed C++ compiler, linker, and resource compiler that are compatible with Microsoft Visual C++ 6.0 
•	Microsoft Windows 2000 RC1 or later version of the Microsoft Platform SDK

It is usually wise to install the Platform SDK last. The Platform SDK provides .h (include) files and .lib (library) files needed for MMC and COM functionality coded in the samples. 

The MMC C++ sample snap-ins assume an environment with the Platform SDK properly installed. However, releases of Microsoft Visual C++ after version 6.0 may also provide the Mmc.h include file and Mmc.lib library file needed for compilation. In such cases, installation of the Platform SDK may not be required to compile the samples. 

Each sample directory has the necessary source files to build and run the sample. For convenient use in Microsoft Visual Studio, a project file is provided for each sample. This file has the .dsp extension. A Samples.dsw workspace file is also provided in the main directory so that you can view and compile all the samples at once from within Visual Studio.
To load the appropriate project for a sample from a command prompt
	1.	Make sure that the directory containing the Msdev.exe executable file of your Visual Studio installation is in your system’s path.
	2.	Run Visual Studio at the command prompt in the sample’s directory as follows:
MSDEV <MYSAMPLE>.DSP

You can also simply double-click the .dsp file in Windows Explorer to load a sample’s workspace into Visual Studio. From within Visual Studio you can then browse the C++ classes of the sample source and generally perform the other edit-compile-debug operations. 

Note that, as part of the Platform SDK, the compilation of these samples from within Visual Studio requires the proper setting of directory paths in Visual Studio. 
To set the directory paths (assuming Visual Studio 6.0) 
	1.	Run Microsoft Visual Studio (Visual C++). 
	2.	On the Tools menu, click Options. 
	3.	In the Options dialog box, click the Directories tab. 
	4.	In the Show Directories For drop-down list box, select “Executable files” and enter the Bin directory path for your installed Platform SDK (for example, D:\Platform SDK\Bin). Click the up arrow button to move this newly entered path so that it is the first entry in the “Directories” list. 
	5.	In the Show Directories For drop-down list box, select “Include files” and enter the INCLUDE directory path for your installed Platform SDK (for example, D:\Platform SDK\Include). Click the up arrow button to move this newly entered path so that it is the first entry in the “Directories” list.
Follow the same procedure for adding the INCLUDE\Win64\mfc and INCLUDE\Win64\crt directory paths to the list of include files. These paths can follow the INCLUDE directory path in the list. Note that INCLUDE refers to the directory path for your installed Platform SDK.
	6.	In the Show Directories For drop-down list box, select “Library files” and enter the Lib directory path for your installed Platform SDK (for example, D:\Platform SDK\Lib). Click the up arrow button to move this newly entered path so that it is the first entry in the “Directories” list. 
	7.	In the Options dialog box, click OK to complete the settings. 

From there you can use the editor, debugger, and project facilities to edit, compile, link, and debug. 
Building ANSI or Unicode Versions of the C++ Samples
All of the MMC C++ samples can be built in both ANSI and Unicode environments. When building a Unicode version of a sample, you should ensure that the proper preprocessor settings are entered in the project settings of the sample’s .dsp project file.
To build a Unicode version of a sample
	1.	Load the sample’s .dsp project file in Microsoft Visual Studio (Visual C++). 
	2.	On the Tools menu, click Project. 
	3.	In the Settings For drop-down list box, select “Win32 Release” for a release build or “Win32 Debug” for a debug build.
	4.	In the Project Settings dialog box, click the C/C++ tab. 
	5.	In the Preprocessor definitions field, make sure that the UNICODE and _UNICODE definitions are included. If not, add them.
6. 	In the Project Settings dialog box, click OK to complete the settings.