Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

FireEvent method

Fires a custom event.


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


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


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


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.



Community Additions

© 2015 Microsoft