Platform SDK: Exchange Server

Setting Up Visual Studio and Visual C++

The following section describes the requirements and configuration steps required to set up your Visual C++ development environment. Once these steps are completed, you can proceed to compile the set of libraries and samples that accompany the Platform SDK for Exchange server. A separate section, Building the COM Components, is provided that details how to go about building the new sample COM components.

Note  We make a distinction here between COM components and the Exchange Library. The Exchange library provides standard DLLs that can be linked into a C++ application using .LIB files.  The COM components are designed to be accessed using the COM runtime. Additionally, the COM components have been designed for use with any programming or scripting language that supports the COM and Automation. The Exchange library is designed specifically for C++ programming tasks, and is centered around using MAPI to access the MIcrosoft Exchange store.

Required Software

The list following contains the software required to use the Exchange Server samples and to develop C++ applications for Exchange.

  1. Windows NT Server Version 3.51 or later as a base platform.
  2. Microsoft Visual C++ Version 5.0 or later (earlier versions are incompatible with the Microsoft Exchange Server SDK).
  3. Microsoft Exchange Client or Microsoft Outlook 97 or later.
  4. Microsoft Exchange Server For developing and testing most types of applications, you will need the entire Microsoft Exchange Server product on your development computer or on a networked computer. Note that some applications require only the Microsoft Exchange Server Administrator program, and some samples can only be run on the machine hosting the Exchange Server. Note: Many of the new samples require Exchange Service Pack 1.
  5. Microsoft Platform SDK Core Build Environment. The Exchange related header files accompany the Platform SDK in the core build environment.
  6. Microsoft Platform SDK Database and Messaging Component The Exchange samples themselves come in the Database and Messaging component of the SDK. If you retrieve the Platform SDK off the Microsoft Developer's Network web site, make sure to get both the core build environment and the Messaging component

The Exchange related header files accompany the Platform SDK in the core build environment. The code for the Exchange library, COM components, and samples come in the Messaging component samples of the Platform SDK. If you retrieve the Platform SDK from the Microsoft Developer's Network (MSDN) site, make sure to get both the core build environment and the Database and Messaging component.

Note  A set of new ASP samples are provided with the Platform SDK and are primarily written in VBScript. However, all of these samples require the use of new Microsoft Exchange sample COM components that must be compiled using Microsoft Visual C++.

Setting Environmental Variables

Microsoft Visual Studio

Microsoft Visual Studio and Visual C++ use a set of environmental variables to point to the locations of header files and libraries used when compiling and linking applications. When you install Microsoft Visual C++, you are prompted to register these various variables so that they are permanently available in your environment. If you choose not to, you can always set them using the batch file VCVARS32.BAT. However, these settings last only the duration of the command-prompt window you used to execute the file. It is recommended that you set these in your environment so that they are always present, whether you are working in Visual Studio directly or from a command prompt window.

Platform SDK

The Platform SDK itself additionally requires a set of environmental variables to point to its necessary header files, libraries, etc. These variables are normally set during the installation and should appear in the installing user's environment. Additionally, in the top directory of the installation is a file called SetEnv.bat that correctly sets these variables if they were not property set during the installation.

Setting Up Directory Options

If you plan on using the Microsoft Developer Studio Integrated Development Environment (IDE) to build the library and samples, you will need to set two options before proceeding. Under Tools->Options, there is a tab labeled "Directories." Click on this tab and then add the following paths to the Include Files and Library Files options respectively: (these are available as pull-down selections)

To Include files, add c:\mssdk\include

To Library files, add c:\mssdk\lib

Substitute the location you installed the Platform SDK in the lines above if c:\mssdk is incorrect. Advance these paths to the top of the order (using the up/down arrow keys) to that the linking will occur against the files in the Platform SDK \lib directory first, then the libraries that come with Visual Studio. The release notes that come with the Platform SDK can be consulted for additional information relevant to your build environment.

Setting the Level of Debugging Output

You can set three additional environment variables to control runtime debug logging :

Microsoft Exchange Server SDK Debug Levels›

Level Purpose
D_PUBLIC Traces calls to public functions.
D_PRIVATE Traces calls to private functions.
D_ERROR Logs ASSERT errors.
D_WARNING Logs warnings.
D_STATUS Logs a specified variable's value.
D_ACTION Logs arbitrary text at code locations you specify, such as Now logging on to MAPI or other actions started or completed.
D_OTHER Logs other requested information, such as a hex dump.

By default, all these debug levels are set and all debug messages are logged to the debug log file. Setting one or more levels listed in this table causes these events to be displayed on screen as well as written to a log file. To set combinations of individual levels, separate level names by commas or spaces, but not both. Example:

SET EDK_DEBUG = D_PUBLIC,D_PRIVATE.

If you do not set the EDK_DEBUG_FILE environment variable and the application is being run as a service of Windows NT Server, debug messages are written to the %SYSTEMROOT% directory, which defaults to C:\WINDOWS\SYSTEM32\. By default, the debug filename is the process identifier in hexadecimal, left-padded with zeroes. For example: 0000005A.LOG.

There are additional functions defined in the header file EDKDEBUG.H that can be used to aid debugging efforts.