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

Using IProvideClassInfo

· 52CE 我爱测

A connectable object can offer the IProvideClassInfo and IProvideClassInfo2 interfaces so that its clients can easily examine its type information. This capability is important when dealing with outgoing interfaces, which, by definition, are defined by an object but implemented by a client on its own sink object. In some cases, an outgoing interface is…

A connectable object can offer the IProvideClassInfo and IProvideClassInfo2 interfaces so that its clients can easily examine its type information. This capability is important when dealing with outgoing interfaces, which, by definition, are defined by an object but implemented by a client on its own sink object. In some cases, an outgoing interface is known at compile time to both the connectable object and the sink object; such is the case with IPropertyNotifySink.

In other cases, however, only the connectable object knows its outgoing interface definitions at compile time. In these cases, the client must obtain the type information for the outgoing interface so that it can dynamically provide a sink supporting the right entry points, as follows:

  1. The client enumerates the connection points and then, to obtain the IIDs of outgoing interfaces supported by the connectable object, calls IConnectionPoint::GetConnectionInterface for each connection point.
  2. The client queries the connectable object for one of the IProvideClassInfo interfaces.
  3. The client calls methods in the IProvideClassInfo interfaces to get the type information for the outgoing interface.
  4. The client creates a sink object supporting the outgoing interface.
  5. The process continues, and the client calls IConnectionPoint::Advise to connect its sink to the connection point.

In the type information, the attribute source marks an interface or dispinterface listed under a coclass as an outgoing interface. Those listed without this attribute are considered incoming interfaces.

Related topics

Connectable Object Interfaces

Providing Class Information

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)

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

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