Click to return to the Reusing Browser Technology home page    
IHTMLStyleElement::get_me...     IHTMLStyleElement::get_on...     IHTMLStyleElement Interfa...    
Web Workshop  |  Reusing Browser Technology

IHTMLStyleElement::get_onerror Method


Retrieves a pointer to the event handler function associated with the onerror event on the STYLE element. This error event occurs when the loading of a document or image causes an error.

Syntax

HRESULT get_onerror(
    VARIANT *p 
);

Parameters

p
Address of a VARIANT structure that contains the error script. For details, see the onerror for more information.

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

Windows CE

Windows CE Use version 2.12 and later
Minimum availability Internet Explorer 4.0

IHTMLStyleElement::put_onerror Method


Sets a pointer to the event handler function associated with the onerror event on the STYLE element. This error event occurs when the loading of a document or image causes an error.

Syntax

HRESULT put_onerror(
    VARIANT v 
);

Parameters

v
VARIANT structure that contains a pointer to the event handler to set, or NULL otherwise. For details, see the onerror for more information.

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

Windows CE

Windows CE Use version 2.12 and later
Minimum availability Internet Explorer 4.0


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.