I have a pointer to a COM object (in C++). Is there a way to get the current reference count of the object which the pointer is pointing to?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Call IUnknown::AddRef
and then immediately IUnknown::Release
. The value returned by the latter is current count of outstanding references. Note that the value does not have to be accurate, it is informational only.