MFC Library Reference
AfxConnectionUnadvise
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 );
Parameters
Return Value
Nonzero if a connection was disconnected; otherwise 0.
Example
Visual C++
//mysink is a CCmdTarget-derived class supporting automation. //Get a pointer to sink's IUnknown, no AddRef done. IID iid = IID_IUnknown; IUnknown* pUnkSink = mysink.GetInterface(&iid); //Terminate a connection between source and sink. //pUnkSrc is IUnknown of server obtained by CoCreateInstance(). //dwCookie is a value obtained through AfxConnectionAdvise(). AfxConnectionUnadvise(pUnkSrc, IID_ISampleSink, pUnkSink, FALSE, dwCookie);
Requirements
Header: afxctl.h
See Also