Tekkaman

导航

 

如何聚合一个组件

1、Add an IUnknown pointer to your class object and initialize it to NULL in the constructor.

2、Override FinalConstruct to create the aggregate. 

3、Use the IUnknown pointer you defined as the parameter to the COM_INTERFACE_ENTRY_AGGREGATE macro.

4、Override FinalRelease to release the IUnknown pointer.

Warning :If you wanna use interface in FinalConstruct,please use DECLARE_PROTECT_FINAL_CONSTRUCT macro to protect your object from deleting.

Examples:

posted on 2011-05-14 13:54  Tekkaman  阅读(845)  评论(0编辑  收藏  举报