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. 

Using the Help C++ Sample
The HTML Help file for the Help sample is Snapsamp.chm. You can find this file in the “help source” subdirectory for the Help sample. Assuming that that D: is the Platform SDK installation drive, Snapsamp.chm is located in:

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

The Help sample assumes that Snapsamp.chm is located in the system help directory (usually C:\WINNT\Help on Microsoft Windows 2000). Therefore, before loading the Help sample into an MMC console, copy Snapsamp.chm to the system help directory.

Using the WMI C++ Sample
The WMI sample connects to the root\Vehicles namespace in the WMI Repository. This namespace is created by compiling the Vehicles.mof MOF file that is part of the WMI sample. To compile the Vehicles.mof file, first make sure that the WMI service is properly installed and running. Then, run the following command in a command prompt from within the WMI sample directory before loading the sample in an MMC console. Here we assume that that the WMI sample is located in the D:\Platform SDK\Samples\SysMgmt\MMC\WMI directory:

wmi_sample_dir:\>MOFComp Vehicles.mof

Note that the MOFComp.exe executable is installed in the system32\wbem directory. For details about MOF files and the MOFComp compiler, see the "Managed Object Format (MOF) Language" topic and related topics in the Platform SDK documentation.

Building the MMC Snap-in Designer for Visual Basic Samples
Refer to the “Snap-in Designer Samples” subtopic in the “Microsoft Management Console” topic in the Microsoft Platform SDK documentation for details about building and running the Snap-in Designer samples.
MMC Snap-in Designer for Visual Basic - Known Issue

Symptom: MMC performs an access violation (AV) while debugging configuration wizards or property pages on Windows 95, Windows 98 or NT4 with Service Pack 5 or less.

Work Around: On Windows 95 and Windows 98 there is no known work around.  On NT4, please upgrade to Service Pack 6.