Share via


EventSource::Add Method

Appends the event handler represented by the specified delegate interface to the set of event handlers for the current EventSource object.

HRESULT Add(
   _In_ TDelegateInterface* delegateInterface,
   _Out_ EventRegistrationToken* token
);

Parameters

  • delegateInterface
    The interface to a delegate object, which represents an event handler.

  • token
    When this operation completes, a handle that represents the event. Use this token as the parameter to the Remove() method to discard the event handler.

Return Value

S_OK if successful; otherwise, an HRESULT that indicates the error.

Requirements

Header: event.h

Namespace: Microsoft::WRL

See Also

Reference

EventSource Class