ATL之如何聚合一个组件
时间:2011-05-14 来源: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:
相关阅读 更多 +