Setting Up the Events Sample Application

Setting Up the Events Sample Application

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

A new user with the account name of "sampleuser" must be created on the computer running Microsoft® Exchange Server 2003 to receive the notification e-mail messages that are sent out when the sample event sinks are triggered.

The Exchange Store Events sample application is installed by default in the \Program Files\Exchange SDK\SDK\Samples\Events\ directory. To use the EventSampleVB executable, you must first build the EventSampleVB.exe file. After the EventSampleVB executable is built, navigate to the \Program Files\Exchange SDK\SDK\Samples\Events\VBEventRegistration\ directory and double-click the EventSampleVB.exe icon to run it.

To build EventSampleVB.exe

  1. Navigate to the \Program Files\Exchange SDK\SDK\Samples\Events\VBEventRegistration\ directory and double-click the EventSampleVB.vbp file icon.

    The EventsSampleRegistration Microsoft Visual Basic® project opens.

  2. In the File menu, click Make EventSampleVB.exe.

  3. In the Make Project window, click OK to build the EventSampleVB.exe file in the \Program Files\Exchange SDK\SDK\Samples\Events\VBEventRegistration\ directory.

The source files for the sample event sinks, contained in ExEvents.dll and SampleEvtSinkVB.dll, are also installed in the default directory. To use the sample event sinks, the dynamic-link libraries (DLLs) must first be built and then registered on the server. Because DLLs run in-process by default, you must wrap the DLLs in out-of-process COM+ components so that the event sinks can be run on Exchange 2000 Server.

To build ExEvents.dll

  1. Navigate to the \Program Files\Exchange SDK\SDK\Samples\Events\CPPEventSinks\ directory and double-click the ExEvents.dsw file icon.

    The ExEvents Microsoft Visual C++® workspace opens.

  2. In the Build menu, click Build ExEvents.dll to build the ExEvents.dll file in the \Program Files\Exchange SDK\SDK\Samples\Events\CPPEventSinks\Release\ directory.

To build SampleEvtSinkVB.dll

  1. Navigate to the \Program Files\Exchange SDK\SDK\Samples\Events\VBEventSinks\ directory and double-click the SampleEvtSinkVB.vbp file icon.

    The SampleEvtSinkVB Visual Basic project opens.

  2. In the File menu, click Make SampleEvtSinkVB.dll.

  3. In the Make Project window, click OK to build the SampleEvtSinkVB.dll file in the \Program Files\Exchange SDK\SDK\Samples\Events\VBEventSinks\ directory.

To set up the sample event sinks

  1. Click Start, point to Programs, click Administrative Tools, and then click Component Services.

  2. Under Console Root, click Component Services, click Computers, and then click My Computer. Under My Computer click COM+ Applications.

  3. Right-click COM+ Applications, point to New, and then click Application.

  4. Click Next, then click Create an empty application.

  5. Type in a name for the application, click the Server application option, and then click Next.

  6. On the Set Application Identity page, click This User. Browse for an appropriate account for running event sinks and enter the password for this account. It is recommended that you not select the Interactive User option because the Exchange server will not normally have a user logged on interactively. Click Next, and then click Finish.

  7. Expand the new application and right-click Components in the tree view.

  8. Click New and then click Component.

  9. When the COM Component Install Wizard starts up, click Next.

  10. Click Import component(s) that are already registered.

    Note  If the DLL(s) weren't registered on the server when they were built, then use the regsvr32 utility to register the DLLs before proceeding to the next step.

  11. If you are using the sample event sinks implemented in Visual C++, select ExEvents.ExEv.1 in the list of components.

    If you are using the sample event sinks implemented in Visual Basic, select SampleEvtSinkVB.AsyncEvents, SampleEvtSinkVB.SyncEvents, SampleEvtSinkVB.SystemEvents, or any combination of the three in the list of components.

  12. Click Next and then click Finish.

    The component(s) you selected from the list of components will now be listed under the COM+ application that you created in the Component Services snap-in.

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.