FireEvent method

Fires a custom event.

Syntax

HRESULT retVal = object.FireEvent(lCookie, pEventObject);

Parameters

  • lCookie [in]
    Type: LONG

    A value of type LONG that identifies the custom event.

  • pEventObject [in]
    Type: IHTMLEventObj

    A pointer to the IHTMLEventObj interface of the event object to be fired.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

A Dynamic HTML (DHTML) behavior uses this method to fire a custom event, pass additional information, and check for any return values. The Dynamic HTML (DHTML) behavior gets return values from the event object by calling the IHTMLEventObj::get_returnValue method or the IHTMLEventObj2::getAttribute method, or by querying the event object for the IDispatchEx interface.

A custom event must be registered through a call to the IElementBehaviorSiteOM::RegisterEvent method.

The Dynamic HTML (DHTML) behavior must release the event object after the object is no longer required.