C++ MAPI – Configuring EDK (Exchange Development Kit)

  • In the directory where the C++ MAPI Exchange kit has been installed, go to $ExchangeSDKLibSrcExchSdkRelease and build the debug versions of the ExchangeSDKd.lib. This library when recompiled will have the proper version of MFC without any problems after recompilation for configuring C++ MAPI EDK.
  • The ExchangeSDKd.lib is nothing but a compounded version of all the other libraries put together in the $ExchangeSDKLibSrc folder. There is one Makefile in this directory, which can be used for building this library. But the MakeFile has to be tinkered a little bit, for making C++ MAPI EDK work in the system.
  • The source code has to be compiled separately either using the make file in the individual projects or by using the VC++ IDE. Thus the C++ MAPI library files has to be generated in the order like AcctCrt.lib, Acl.lib, AddrLkup.lib … till Winwrap.lib.
  • The following make file can be used, instead of the one from the C++ MAPI EDK. This has been modified a little bit and made to work for my system.

#!include <disable.mak>
# Description:
# Make File to assemble the libraries for the C++
# Copyright (C) Microsoft Corp. 1986-1998. All Rights

USE_ExchANGE = 1

Proj = ExchSDK

!include <BkOffice.Mak>


NBLibList =

# C++ MAPI EDK - If any of the above compilations doesn't
work, just comment the code by placing a "#" in front of the

all: ReleaseExchSDK$(DbgLibFlag).Lib

ReleaseExchSDK$(DbgLibFlag).Lib: $(LibList)
$(LIBU) $(LIBFLAGS) $(LibList) $(NBLibList) $(LogCmd)
set copycmd=/y
XCopy "$@" "$(LibDir)" $(LogCmd)

If some one does not know how to use MakeFile, it is nothing but calling nmake.exe in the folder where this MakeFile and the requried source files are present. This will build the required library files for C++ MAPI EDK programming.

  • This makefile will generate a ExchangeSDKd.lib library, which can be used from now on. But with this, include the following header file in the project to avoid some more linking problems.

// GWMain.h
// Add this file to resolve the linker errors while
generating the required C++ MAPI EDK libraries.

extern "C" void GWMain(void)

// HrGWLogon
extern "C" HRESULT HrGWLogon(void)

// HrGWLogoff
extern "C" HRESULT HrGWLogoff(void)

  • Copy the library file to C:Program FilesMicrosoft Visual StudioVC98Lib. Keep a back-up of the old library in the same directory. This should set up the Exchange development environment properly. This will allow us to start working on MAPI projects now.

If there is any need, users can Download the Exchange development kit from Microsoft for local installation.