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++
MAPI EDK
#
# Copyright (C) Microsoft Corp. 1986-1998. All Rights
Reserved.
#
#----------------------------------------------------------------------------

USE_ExchANGE = 1

Proj = ExchSDK

!include <BkOffice.Mak>

LibList=
..EXAdminReleaseEXAdmin.Lib
..AddrLkupReleaseAddrLkup.Lib
..EDKCfgReleaseEDKCfg.Lib
..EDKDebugReleaseEDKDebug.Lib
..EDKEventReleaseEDKEvent.Lib
..EDKGUIDReleaseEDKGUID.Lib
..EDKMAPIReleaseEDKMAPI.Lib
..EDKMsgReleaseEDKMsg.Lib
..EDKTrackReleaseEDKTrack.Lib
..EDKUtilsReleaseEDKUtils.Lib
..ExchInstReleaseExchInst.Lib
..GWMainReleaseGWMain.Lib
..GWReportReleaseGWReport.Lib
..MBLogonReleaseMBLogon.Lib
..MesgXlatReleaseMesgXlat.Lib
..MonitorReleaseMonitor.Lib
..NewPstReleaseNewPst.Lib
..StatsReleaseStats.Lib
..WinWrapReleaseWinWrap.Lib
..GWPerfReleaseGWPerf.Lib

NBLibList =
DAPI.Lib
RtfLIB32.Lib
SADAPI.Lib
MAPI32.Lib
DMAPIW32.Lib

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

all: ReleaseExchSDK$(DbgLibFlag).Lib

ReleaseExchSDK$(DbgLibFlag).Lib: $(LibList)
$(MkDest)
$(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)
{
return;
}

// HrGWLogon
extern "C" HRESULT HrGWLogon(void)
{
return MAPI_E_CALL_FAILED;
}

// HrGWLogoff
extern "C" HRESULT HrGWLogoff(void)
{
return MAPI_E_CALL_FAILED;
}

  • 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.