About the IExchangeEventHandler Interface

Every agent must implement the IExchangeEventHandler interface in its object. This interface has one method:

    ExecuteEvent( IDispatch* pEventSource)

An EventSource is a COM object that exposes one interface: IEventSource. It has no methods, just the following properties:

Property Description
Source MAPI object (the agent message in the target folder)
SourceID Entry identifier of the agent message in the EventConfig_<ServerName> folder
MessageID Entry identifier of the message that was changed, added, or deleted (NULL for timer events)
Session The MAPI session passed from the Microsoft Exchange Event Service
EventType The type of event that occurred (an integer enumeration: 0, 1, 2, or 3)
MaxExecutionTime Seconds of execution from beginning of agent execution until agent execution is terminated.
Response Put a string here to record the outcome of the agent's execution. The string is written to the event log. The Response property is a variant, but the Event Service expects a string (if not a string, it will be ignored).