Edit

Optional Methods

An OLE component can implement an interface without implementing all the semantics of every method in the interface, instead returning E_NOTIMPL or S_OK as appropriate. The following table describes those methods that an ActiveX control container is not required to implement (i.e. the control container can return E_NOTIMPL).

The table below describes optional methods; note that the method must still exist, but can simply return E_NOTIMPL instead of implementing real semantics. Note that any method from a mandatory interface that is not listed below must be considered mandatory and may not return E_NOTIMPL.

IOleClientSite

Method Comments
SaveObject
Necessary for persistence to be successfully supported.
GetMoniker
Necessary only if the container supports linking to controls within its own form or document.

IOleInPlaceSite

Method Comments
ContextSensitiveHelp
Optional
Scroll
May return S_FALSE with no action.
DiscardUndoState
Can return S_OK with no action.
DeactivateAndUndo
Deactivation is mandatory; Undo is optional.

IOleControlSite

Method Comments
GetExtendedControl
Necessary for containers that support extended controls.
ShowPropertyFrame
Necessary for containers that wish to include their own property pages to handle extended control properties in addition to those provided by a control.
TranslateAccelerator
May return S_FALSE with no action.
LockInPlaceActive
Optional

IDispatch (Ambient properties)

Method Comments
GetTypeInfoCount
Necessary for containers that support non-standard ambient properties.
GetTypeInfo
Necessary for containers that support non-standard ambient properties.
GetIDsOfNames
Necessary for containers that support non-standard ambient properties.

IDispatch (Event sink)

Method Comments
GetTypeInfoCount
The control knows its own type information, so it has no need to call this.
GetTypeInfo
The control knows its own type information, so it has no need to call this.
GetIDsOfNames
The control knows its own type information, so it has no need to call this.

IOleInPlaceFrame

Method Comments
ContextSensitiveHelp
GetBorder
Necessary for containers with toolbar UI (which is optional)
RequestBorderSpace
Necessary for containers with toolbar UI (which is optional)
SetBorderSpace
Necessary for containers with toolbar UI (which is optional)
InsertMenus
Necessary for containers with menu UI (which is optional)
SetMenu
Necessary for containers with menu UI (which is optional)
RemoveMenus
Necessary for containers with menu UI (which is optional)
SetStatusText
Necessary only for containers that have a status line
EnableModeless
Optional
TranslateAccelerator
Optional

IOleContainer

Method Comments
ParseDisplayName
Only if linking to controls or other embeddings in the container is supported, as this is necessary for moniker binding.
LockContainer
As for ParseDisplayName
EnumObjects
Returns all ActiveX controls through an enumerator with IEnumUnknown, but not necessarily all objects (because there's no guarantee that all objects are ActiveX controls; some may be regular Windows controls).

Containers