开发者

pUnkOuter parameter of IClassFactory::CreateInstance method

What's the reason behind the pUnkOuter pa开发者_JAVA技巧rameter of IClassFactory::CreateInstance method?

HRESULT CreateInstance(
  [in]   IUnknown *pUnkOuter,
  [in]   REFIID riid,
  [out]  void **ppvObject
);

The MSDN's description of pUnkOuter parameter notes:

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.

Can you good people please enlighten me on what is this parameter for?


See Aggregation in COM fundamentals. If you create an instance of COM object which is a part of an aggregate, you have to supply so called "outer IUnknown", which is owner COM object interface.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜