大网数据广告活动
Windows 系统接口

Required Interfaces (COM)

· 52CE 我爱测

Learn about the ActiveX Control Container interfaces that can or must be implemented by control containers.

The table below lists the ActiveX Control Container interfaces, and denotes which interfaces are optional, and which are mandatory and must be implemented by control containers.

Interface Required? Comments
IOleClientSite Yes
IAdviseSink No Only when the container desires (a) data change notifications (controls with IDataObject), (b) view change notification (controls that are not active and have IViewObject or IViewObject2), and (c) other notifications from controls acting as standard embedded objects.
IOleInPlaceSite Yes
IOleControlSite Yes
IOleInPlaceFrame Yes
IOleContainer Yes See note 1
IDispatch for ambient properties Yes See note 2 and Ambient Properties for Controls
Control Event Sets Yes See note 2
ISimpleFrameSite No ISimpleFrameSite and support for nested simple frames is optional.
IPropertyNotifySink No Only needed for containers that (a) have their own property editing UI which would require updating whenever a control changed a property itself or (b) want to control [requestedit] property changes and other such data-binding features.
IErrorInfo Yes Mandatory if container supports dual interfaces. See note 2.
IClassFactory2 No Support is strongly recommended.
  1. IOleContainer is implemented on the document or form object (or appropriate analog) that holds the container sites. Controls use IOleContainer to navigate to other controls in the same document or form.
  2. Support for dual interfaces is not mandatory, but is strongly recommended. Writing ActiveX control containers to take advantage of dual interfaces will afford better performance with controls that offer dual interface support.

ActiveX control containers must support OLE Automation exceptions. If a control container supports dual interfaces, then it must capture automation exceptions through IErrorInfo.

Related topics

Containers

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。