Setting Environment Variables

To prepare your system for developing Microsoft Exchange Server applications, make sure the proper changes have been made to the system environment variables. Remove any out-of-date settings when updating Microsoft Visual C++ or Microsoft Exchange Server. For best results, remove any extra semicolons. They may be tolerated in the PATH variable, but will cause errors in the INCLUDE and LIB variables.

    To verify that environment variables are set correctly
  1. Type SET at a command prompt to view a list of all environment variable settings. All variables listed in the following steps should be present. If you see any problems, modify the systems settings found in the Control Panel as directed.
  2. At the Windows NT Control Panel, choose System. The System dialog box provides settings for System Environment Variables and User Environment Variables. (If you are using version 4.0 or later of Windows NT, click the Environment tab, and edit System Variables or User Variables.) When changing these variables, note that user environment variables take precedence over system environment variables.
  3. Make sure the following system environment variables are set. If not, change their values in the System Environent Variables list box:

    BASEMAKE = C:\BKOFFICE\INCLUDE\BASEMAKE.INC

    BKOFFICE = C:\BKOFFICE\

  4. Make sure the following INCLUDE system environment variables are set. If not, add the following directories in this order:

    C:\BKOFFICE\INCLUDE
    C:\MSDEV\INCLUDE
    C:\MSDEV\MFC\INCLUDE
    C:\MSTOOLS\INCLUDE

  5. Make sure the following LIB system environment variables are set. If they are not, add the following directories in this order:

    C:\BKOFFICE\LIB\I386
    C:\MSDEV\LIB
    C:\MSDEV\MFC\LIB
    C:\MSTOOLS\LIB

  6. Make sure the following PATH system environment variables are set. If they are not, add the following directories in this order:

    C:\BKOFFICE\BIN
    C:\MSDEV\BIN
    C:\MSTOOLS\BIN

    If Microsoft Exchange Server is to be installed locally, add this directory:

    C:\EXCHSRVR\BIN

  7. If you changed your environment variables, you can verify them by typing SET at a command prompt.
  8. Optionally, 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.

You can use macros and functions described in EDKDEBUG.H to add extra error-logging flexibility and make debugging easier.