IClassFactory::CreateInstance 方法的pUnkOuter
参数背后的原因是什么?
HRESULT CreateInstance(
[in] IUnknown *pUnkOuter,
[in] REFIID riid,
[out] void **ppvObject
);
MSDN对pUnkOuter
参数说明的说明:
If the object is being created as part of an aggregate, specify a pointer to the controlling IUnknown interface of the aggregate. Otherwise, this parameter must be NULL.
请问各位大神,请问这个参数是做什么用的?
最佳答案
参见 Aggregation在 COM 基础知识中。如果您创建作为聚合一部分的 COM 对象实例,则必须提供所谓的“外部 IUnknown”,它是所有者 COM 对象接口(interface)。
关于c++ - IClassFactory::CreateInstance 方法的 pUnkOuter 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7595263/