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

Optional Methods in Control Interfaces

· 52CE 我爱测

Optional Methods in Control Interfaces

Implementing an interface doesn't necessarily mean implementing all methods of that interface to do anything more than return E_NOTIMPL or S_OK as appropriate. The following table identifies the methods of the interfaces listed in the What Support for an Interface Means topic that a control may implement in this manner. Any method not listed here must be fully implemented if the interface is supported.

IOleControl Comments
GetControlInfo, OnMnemonic Mandatory for controls with mnemonics.
IOleControl::OnAmbientPropertyChange Mandatory for controls that use ambient properties.
IOleControl::FreezeEvents See Event Freezing
IOleObject
SetMoniker Mandatory if the control is not marked with OLEMISC_CANTLINKINSIDE
GetMoniker Mandatory if the control is not marked with OLEMISC_CANTLINKINSIDE
InitFromData Optional
GetClipboardData Optional
SetExtent Mandatory only for DVASPECT_CONTENT
GetExtent Mandatory only for DVASPECT_CONTENT
SetColorScheme Optional
DoVerb See note 1
IOleInPlaceObject
ContextSensitiveHelp Optional
ReactivateAndUndo Optional
IOleInPlaceActiveObject
ContextSensitiveHelp Optional
IViewObject2
Freeze Optional
Unfreeze Optional
GetColorSet Optional
IPersistStream, IPersistStreamInit, IPersistMemory
GetSizeMax See note 2
  1. A control with property pages must support IOleObject::DoVerb for the OLEIVERB_PROPERTIES and OLEIVERB_PRIMARY verbs. A control that can be active must support DoVerb for the OLEIVERB_INPLACEACTIVATE verb. A control that can be UI active must also support DoVerb for the OLEIVERB_UIACTIVATE verb.
  2. If a control supports IPersistStream or IPersistStreamInit and can return an accurate value, then it should do so.

Related topics

Controls

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)

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

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