5/9/08

What is the purpose of the second argument to CoCreateInstance()?

When an outer object creates an aggregated inner object, it uses the second argument
of the CoCreateInstance() function to pass the address of its IUnknown pointer (the
controlling unknown) to the inner object's class factory. If this address is not NULL, the inner object knows that it is being aggregated, and delegates IUnknown method calls
from external clients to the controlling unknown.

No comments: