事件和连接点有什么区别啊?!怎么样实现事件源啊?
连接点好象是通过循环来访问连接对象的,在非属性化中能不能简单的提供事件源?
连接点好象是通过循环来访问连接对象的,在非属性化中能不能简单的提供事件源?
解决方案 »
- MFC问题,高手们都来解答吧!
- 请问在BCG里动态创建菜单
- fatal error C1001: INTERNAL COMPILER ERROR错误问题
- 根据类的字符串名字,动态创建一个类的实例,CRuntimeClass
- 请教高手:我在vs.net2003下编译下列小程序,出现的错误应该如何处理,才能避免错误发生?
- 在基于对话框的程序中,如何用CStatic显示外部exe,dll,icl中的图标
- 高手帮我看看这段程序为什么没有效果?关于目录共享的。
- 各位大俠﹐我有一個基本問題。
- 请问怎样在CFileDialog派生的对话框中取得目录及输入的文件名?在线等待!
- 有关Ftp的Port命令一问?
- 如何让界面上的cstatic变成透明的,我设置了它的属性没有效,怎么办?》??
- 刚才找到了份介绍BT原理的文章,看完后,如果他写的是没错的话,那我要对BT感到失望~虽然BT传输的做得不错,但还是有很大的缺点,大家不
2. b implements event sink interface
3. b connect to a thru connection point
4. when something happend (event), b notifies a thru event sink interface
1. a implements connection point
2. b implements event sink interface
3. b connect to a thru connection point
4. when something happend (event), a notifies b thru event sink interface
如果一个IUnknown派生的接口,定义为[default, source],在实现的时候是连接点,
那么他能用SINK_ENTRY来触发事件吗?
2。而event sink是接收消息的地方。
3。连接点是IConnectionPoint, 一个对象实现了IConnectionPoint,那么它是可连接对象。
4。一个对象如果实现了IConnectionPoint, 那么它的客户就可以通过这个接口把客户的IUnknown接口传给这个对象,这样,这个对象,在特定的情况下才可能发送event给客户。
5。如果客户想得到对象发送过来的event,它必须和对象协调传递event的方式,这就是outgoing interface,这个接口由对象来定义,由客户来实现。当对象处发生了某一事件,他会通过这个outgoing接口来通知客户程序。
implements IConnectionPoint interface
Client connect to the object through
IConnection interface -->
define an outgoing interface
implement the outgoing interface
<--- Send event through the outgoing interface
step1: When you Insert ATL Object Check Connection Pointer
step2:Add Connection Pointer In you Class