Retrieves a pointer to the event handler function associated with the onreadystatechange event on the OBJECT element. This event is fired whenever the readyState property for the object has changed.
Syntax
HRESULT get_onreadystatechange( VARIANT *p );
Parameters
- p
- Address of a VARIANT structure that contains a pointer to the event handler, or NULL otherwise.
Return Value
Returns S_OK if successful, or an error code otherwise.
Remarks
Use the following code fragment to obtain an event handler.pBody->get_onEvent( &_variant_t(pDisp) ); // pDisp a pointer to an IDispatch interface // pBody a pointer to an element of interest
Sets a pointer to the event handler function associated with the onreadystatechange event on the OBJECT element. This event is fired whenever the readyState property for the object has changed.
Syntax
HRESULT put_onreadystatechange( VARIANT v );
Parameters
- v
- VARIANT structure that contains a pointer to the event handler to set, or NULL otherwise.
Return Value
Returns S_OK if successful, or an error code otherwise.
Remarks
Use the following code fragment to set an event handler. This method will only add a single event handler. To add multiple event handlers, see the IHTMLDocument3::attachEvent, IHTMLElement2::attachEvent, and IHTMLWindow3::attachEvent methods.
pBody->put_onEvent( &_variant_t(pDisp) ); // pDisp a pointer to an IDispatch interface // pBody a pointer to an element of interest