Creating an Aggregated Object
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Creating an Aggregated Object.
Aggregation delegates IUnknown calls, providing a pointer to the outer object's IUnknown to the inner object.
To create an aggregated object
Add an IUnknown pointer to your class object and initialize it to NULL in the constructor.
Override FinalConstruct to create the aggregate.
Use the IUnknown pointer, defined in Step 1, as the second parameter for the COM_INTERFACE_ENTRY_AGGREGATE macros.
Override FinalRelease to release the IUnknown pointer.
If you use and release an interface from the aggregated object during |