HRESULT CoDisconnectObject(IUnknown *pIUnknown, DWORD Reserve);
#include <windows.h> #include <winbase.h> #include <ole2.h> IUnknown *pIUnknown; ... if (CoDisconnectObject(pIUnknown, 0)!=S_OK) { ... } ...