Required Interfaces

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[2]), 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 ControlsGCS4S4 section

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.