Gets the element to which a Dynamic HTML (DHTML) behavior is attached.
HRESULT retVal = object.GetElement(ppElement);
- ppElement [out, retval]
A pointer to an IHTMLElement interface that specifies the element to which the Dynamic HTML (DHTML) behavior is attached.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
A Dynamic HTML (DHTML) behavior can access the host Dynamic HTML (DHTML) Object Model through the element that is retrieved by this method.
This method returns a pointer to the master element of a behavior. Do not cache the pointer returned by this method. During the IElementBehavior::Init call, cache a pointer to the IElementBehaviorSite interface, and use the GetElement method whenever necessary.
If the ppElement pointer is cached, then Windows Internet Explorer calls AddRef to increment the reference count on the behavior. This practice can cause memory leaks when the behavior is shut down, because references to the behavior remain.