Binds the specified function to an event, so that the function gets called whenever the event occurs.
JavaScript |
|
AttachEvent( bstrEventName, dispFunc) |
C# |
|
void AttachEvent( string bstrEventName, object dispFunc) |
C++ |
|
HRESULT AttachEvent( BSTR bstrEventName, VARIANT dispFunc) |
Parameters
bstrEventName
A string representing the event name.
dispFunc
The function that should be called when the event occurs or a delegate to the function in C#.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.