AfxConnectionUnadvise
呼叫這個函式不同來源之間的連接,由 pUnkSrc和接收,指定由 pUnkSink。
BOOL AFXAPI AfxConnectionUnadvise(
LPUNKNOWN pUnkSrc,
REFIID iid,
LPUNKNOWN pUnkSink,
BOOL bRefCount,
DWORD dwCookie
);
參數
pUnkSrc
呼叫介面之物件的指標。pUnkSink
物件的指標。實作介面。iid
連接點介面的介面 ID。bRefCount
TRUE 表示中斷連接應該導致參考 pUnkSink 的計數會遞減。 FALSE 表示不應遞減參考計數。dwCookie
AfxConnectionAdvise傳回的連接識別項。
傳回值
非零,如果連接中斷連接;否則為 0。
範例
//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);
需求
Header: afxctl.h