共用方式為


DECLARE_PROTECT_FINAL_CONSTRUCT

Protects your object from being deleted if (during FinalConstruct) the internal aggregated object increments the reference count then decrements the count to 0.

DECLARE_PROTECT_FINAL_CONSTRUCT( )

Requirements

Header: atlcom.h

See Also

Concepts

Aggregation and Class Factory Macros

ATL Macros