Platform SDK: Exchange Server |
Before building the samples, you should make sure you have set up Developer Studio and Visual C++ as outlined in the Development Environment section. This basically consists of two steps:
Once completed, you can proceed to build the samples. With this release of the Platform SDK, all of the Exchange programming samples can be compiled and linked directly from the Developer Studio environment. The directory <c:\mssdk>\Samples\DBMSG\EXCHANGE\SAMPLES directory contains a workspace file EdkSamples.dsw that can be used to do so. Additionally, each sample has a separate project file (*.dsp) that can be used to build it separately if desired. The steps are listed below.
Steps for Building A Sample in Visual Studio
Linking Debug and Release Configurations to the Exchange Library
The debug versions of all the samples link against the library "exchsdkd.lib". The release versions link against the library "exchsdk.lib." (The only difference in the name is the trailing "d" character). If you have not compiled and linked either the debug or release library, or if for some reason the library was not successfully copied to the <c:\mssdk\lib> directory, the link step for the sample will generate an error:
LINK : fatal error LNK1104: cannot open file "exchsdkd.lib" Error executing link.exe.
These libraries must be in a \LIB directory that is visible in the "Library files" Directories option within Developer Studio. When the library is built, a post-build step copies them it the %BkOffice%\LIB directory as described in the section Development Environment. If you are experiencing problems in the link step for a sample, check to make sure the required library file has been copied properly to the c:\mssdk\lib directory.
ASP Samples
For some of the ASP samples, you first need to do the following:
The proceeding steps are discussed in the following sections.
The following steps outline how to build and register the COM components provided for Exchange Server in the Platform SDK.
The component is registered automatically by Visual Studio after the build is complete. If you have built the component on a different machine than the one on which you would like to run the sample, you will need to copy the component to that machine and register it. At the command prompt, type the following:
regsvr32.exe <name>.dll
To unregister the component, type
regsvr32.exe /u <name>.dll
Note If you use Microsoft Visual Studio 6.0 to build the components, and you select a MinSize active configuration for any of them, you will need to copy the ATL.DLL version 3.0 library onto the machine you install the component. This library is a part of the Visual Studio 6.0 product. The MinSize configurations use code contained in this dynamic link library and it is therefore required for the component to run properly.
Some of the samples are Active Server Pages (ASP) samples. In order to run these samples, you will need to configure Internet Information Server (IIS). These steps are outlined in the following list.