Adds the specified behavior to the list of behaviors influencing this element.
Syntax
HRESULT addBehavior( BSTR bstrUrl, VARIANT *pvarFactory, long *pBehaviorID );
Parameters
- bstrUrl
- String (BSTR) variable that specifies the URL for the behavior to be added to the element.
- pvarFactory
- Address of a VARIANT structure to an ElementBehaviorFactory interface for the behavior.
- pBehaviorID
- Address of a long pointer returning the new behavior's ID.
Return Value
Returns S_OK if successful, or an error code otherwise.
Remarks
Behaviors are subject to cross-frame security rules where a web page may not refer to a behavior on another server, or another domain. In this case, the addBehavior method returns E_ACCESSDENIED. For more information, see the Security section in the DHTML Behaviors article.
See Also
removeBehavior