Setting Up the Events Sample Application

Topic Last Modified: 2006-06-11

A new user with the account name of "sampleuser" must be created on the computer running Microsoft® Exchange Server 2007 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. Expand the new application and right-click Components in the tree view.

  5. Click New and then click Component.

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

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