Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Binds the specified function to an event so that the function gets called whenever the event fires on the object.
Syntax
HRESULT attachEvent( BSTR sEvent, IDispatch* pDisp );
Parameters
- sEvent
- Required. Specifies the name of the event.
- pDisp
- Required. Specifies an IDispatch pointer of an object to be called whenever sEvent fires.
Return Value
Returns S_OK if the function was bound successfully, or an error value otherwise.
Remarks
When sEvent fires on the object, the object's sEvent handler is called first before the specified function, pDisp. If multiple functions are attached to the same event on the same object, the pDisp(s) will be called in a random order, immediately after the object's event handler is called.
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.