HOWTO: Enable ActiveX Control Event Handling on a Web PageID: Q200839
|
An ActiveX control must implement the IProvideClassInfo or IProvideClassInfo2 interface to enable event handling on a Web page. Microsoft Internet Explorer uses this interface to obtain the type library for the control and determine the available event set.
Using a script language, such as VBScript or JavaScript, a Web page author can use automation to invoke methods/properties and handle events for an ActiveX control placed on the page with an HTML <OBJECT> tag.
For an ActiveX control to support such event handling, it must implement the IProvideClassInfo or IProvideClassInfo2 interface. Internet Explorer queries the control for these interfaces and, if implemented, calls the GetClassInfo() method to obtain the type library for the control. Internet Explorer will initially query the control for IProvideClassInfo2 and, if this is not implemented, will then query for IProvideClassInfo.
The IProvideClassInfo2 interface is derived from IProvideClassInfo and provides an additional method, GetGUID(), which returns an object's outgoing interface ID for it's default event set.
For ActiveX controls developed using the Microsoft Foundation Classes, the IProvideClassInfo2 interface is implemented by default.
For ActiveX controls developed using Microsoft Visual Basic, the IProvideClassInfo interface is implemented by default.
When using the Microsoft Active Template Library (ATL), version 3.0, the following 'lite control' ATL objects do not implement the IProvideClassInfo2 interface by default:
public IProvideClassInfo2Impl<&CLSID_<object_name>, NULL,
&LIBID_<project_name>Lib>
COM_INTERFACE_ENTRY(IProvideClassInfo)
COM_INTERFACE_ENTRY(IProvideClassInfo2)
For more information about the Active Template Library and implementing ActiveX controls, please consult the Microsoft Visual C++ Online documentation.
For more information, please see the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/default.asp(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Mark Davis, Microsoft Corporation.
Additional query words: kbDSupport
Keywords : kbActiveX kbActivexEvents kbCtrlCreate kbIE300 kbIE301 kbIE400 kbIE401 kbInternet kbIE302 kbIE401sp1 kbIE401sp2 kbIE500 kbInetDev
Version : WINDOWS:3.0,3.01,3.02,4.0,4.01,4.01 SP1,4.01 SP2,5.0,6.0; winnt:
Platform : WINDOWS winnt
Issue type : kbhowto
Last Reviewed: July 21, 1999