Notifies the Dynamic HTML (DHTML) behavior that it has been instantiated.
Syntax
HRESULT Init( IElementBehaviorSite *pBehaviorSite );
Parameters
- pBehaviorSite
- [in] Address of the IElementBehaviorSite interface through which the DHTML behavior communicates with MSHTML.
Return Value
Returns S_OK if successful, or an error code otherwise.
Remarks
The Init method is the first notification received by the DHTML behavior after it is instantiated by MSHTML, through a call to the IElementBehaviorFactory::FindBehavior method. Any initialization required for the DHTML behavior can be done at this point.
You can query the IElementBehaviorSite interface that is passed to the Init method for the IElementBehaviorSiteOM, IElementBehaviorSiteCategory, IBindHost, and IServiceProvider interfaces.
Call the IElementBehaviorSite::GetElement method to retrieve the element to which the DHTML behavior is attached.
MSHTML calls the IElementBehavior::Notify method to indicate when the element and document, to which the DHTML behavior is attached, are fully parsed. If the DHTML behavior needs to be downloaded, the contents of the document might be parsed before the Init method is called and IElementBehavior::Notify will not be called.