Visual Studio .NET 2003
Call this function to disconnect a connection between a source, specified by pUnkSrc, and a sink, specified by pUnkSink.
BOOL AFXAPI AfxConnectionUnadvise( LPUNKNOWN pUnkSrc, REFIID iid, LPUNKNOWN pUnkSink, BOOL bRefCount, DWORD dwCookie );
- A pointer to the object that calls the interface.
- A pointer to the object that implements the interface.
- The interface ID of the connection point interface.
- TRUE indicates that disconnecting the connection should cause the reference count of pUnkSink to be decremented. FALSE indicates that the reference count should not be decremented.
- The connection identifier returned by AfxConnectionAdvise.
Nonzero if a connection was disconnected; otherwise 0.
//m_pSink is a ptr to CCmdTarget-derived class supporting automation. //Get a pointer to sinks IUnknown, no AddRef done. LPUNKNOWN pUnkSink = m_pSink->GetIDispatch(FALSE); //Terminate a connection between source and sink. //m_pUnkSrc is IUnknown of server obtained by CoCreateInstance(). //m_dwCookie is a value obtained through AfxConnectionAdvise(). AfxConnectionUnadvise(m_pUnkSrc, IID_MYEVENT, pUnkSink, FALSE, m_dwCookie);