本文整理汇总了C++中ITfSource::UnadviseSink方法的典型用法代码示例。如果您正苦于以下问题:C++ ITfSource::UnadviseSink方法的具体用法?C++ ITfSource::UnadviseSink怎么用?C++ ITfSource::UnadviseSink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITfSource
的用法示例。
在下文中一共展示了ITfSource::UnadviseSink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Uninitialize
HRESULT CCompartmentMonitor::Uninitialize(void)
{
HRESULT hr = S_OK;
if(m_pCompartment)
{
ITfSource *pSource;
hr = m_pCompartment->QueryInterface(IID_ITfSource, (void **)&pSource);
if(SUCCEEDED(hr))
{
hr = pSource->UnadviseSink(m_dwCookie);
pSource->Release();
}
m_pCompartment->Release();
m_pCompartment = NULL;
}
m_guidCompartment = GUID_NULL;
return hr;
}
示例2: _Unadvise
HRESULT CTextEditSink::_Unadvise()
{
HRESULT hr;
ITfSource *source = NULL;
hr = E_FAIL;
if (_pic == NULL)
goto Exit;
if (FAILED(_pic->QueryInterface(IID_ITfSource, (void **)&source)))
goto Exit;
if (FAILED(source->UnadviseSink(_dwEditCookie)))
goto Exit;
hr = S_OK;
Exit:
if (source)
source->Release();
if (_pic)
{
_pic->Release();
_pic = NULL;
}
return hr;
}
示例3: _InitTextEditSink
BOOL CSampleIME::_InitTextEditSink(_In_ ITfDocumentMgr *pDocMgr)
{
ITfSource* pSource = nullptr;
BOOL ret = TRUE;
// clear out any previous sink first
if (_textEditSinkCookie != TF_INVALID_COOKIE)
{
if (SUCCEEDED(_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource)))
{
pSource->UnadviseSink(_textEditSinkCookie);
pSource->Release();
}
_pTextEditSinkContext->Release();
_pTextEditSinkContext = nullptr;
_textEditSinkCookie = TF_INVALID_COOKIE;
}
if (pDocMgr == nullptr)
{
return TRUE; // caller just wanted to clear the previous sink
}
if (FAILED(pDocMgr->GetTop(&_pTextEditSinkContext)))
{
return FALSE;
}
if (_pTextEditSinkContext == nullptr)
{
return TRUE; // empty document, no sink possible
}
ret = FALSE;
if (SUCCEEDED(_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource)))
{
if (SUCCEEDED(pSource->AdviseSink(IID_ITfTextEditSink, (ITfTextEditSink *)this, &_textEditSinkCookie)))
{
ret = TRUE;
}
else
{
_textEditSinkCookie = TF_INVALID_COOKIE;
}
pSource->Release();
}
if (ret == FALSE)
{
_pTextEditSinkContext->Release();
_pTextEditSinkContext = nullptr;
}
return ret;
}
示例4: _UninitThreadFocusSink
void CExtentMonitorTextService::_UninitThreadFocusSink()
{
ITfSource *pSource;
if (_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
{
pSource->UnadviseSink(_dwThreadFocusCookie);
pSource->Release();
}
}
示例5: _InitTextEditSink
BOOL CTextService::_InitTextEditSink(ITfDocumentMgr *pDocumentMgr)
{
BOOL fRet = FALSE;
if(_pTextEditSinkContext != nullptr && _dwTextEditSinkCookie != TF_INVALID_COOKIE)
{
ITfSource *pSource = nullptr;
if(SUCCEEDED(_pTextEditSinkContext->QueryInterface(IID_PPV_ARGS(&pSource))) && (pSource != nullptr))
{
pSource->UnadviseSink(_dwTextEditSinkCookie);
SafeRelease(&pSource);
}
SafeRelease(&_pTextEditSinkContext);
_dwTextEditSinkCookie = TF_INVALID_COOKIE;
}
if(pDocumentMgr == nullptr)
{
return TRUE;
}
if(FAILED(pDocumentMgr->GetTop(&_pTextEditSinkContext)))
{
return FALSE;
}
if(_pTextEditSinkContext == nullptr)
{
return TRUE;
}
{
ITfSource *pSource = nullptr;
if(SUCCEEDED(_pTextEditSinkContext->QueryInterface(IID_PPV_ARGS(&pSource))) && (pSource != nullptr))
{
if(SUCCEEDED(pSource->AdviseSink(IID_IUNK_ARGS((ITfTextEditSink *)this), &_dwTextEditSinkCookie)))
{
fRet = TRUE;
}
else
{
_dwTextEditSinkCookie = TF_INVALID_COOKIE;
}
SafeRelease(&pSource);
}
}
if(fRet == FALSE)
{
SafeRelease(&_pTextEditSinkContext);
}
return fRet;
}
示例6: _InitTextEditSink
BOOL CTextService::_InitTextEditSink(ITfDocumentMgr *pDocMgr)
{
ITfSource *pSource;
BOOL fRet;
// clear out any previous sink first
if (_dwTextEditSinkCookie != TF_INVALID_COOKIE)
{
if (_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
{
pSource->UnadviseSink(_dwTextEditSinkCookie);
pSource->Release();
}
_pTextEditSinkContext->Release();
_pTextEditSinkContext = NULL;
_dwTextEditSinkCookie = TF_INVALID_COOKIE;
}
if (pDocMgr == NULL)
return TRUE; // caller just wanted to clear the previous sink
// setup a new sink advised to the topmost context of the document
if (pDocMgr->GetTop(&_pTextEditSinkContext) != S_OK)
return FALSE;
if (_pTextEditSinkContext == NULL)
return TRUE; // empty document, no sink possible
fRet = FALSE;
if (_pTextEditSinkContext->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
{
if (pSource->AdviseSink(IID_ITfTextEditSink, (ITfTextEditSink *)this, &_dwTextEditSinkCookie) == S_OK)
{
fRet = TRUE;
}
else
{
_dwTextEditSinkCookie = TF_INVALID_COOKIE;
}
pSource->Release();
}
if (fRet == FALSE)
{
_pTextEditSinkContext->Release();
_pTextEditSinkContext = NULL;
}
return fRet;
}
示例7: _UninitThreadMgrEventSink
void WeaselTSF::_UninitThreadMgrEventSink()
{
ITfSource *pSource;
if (_dwThreadMgrEventSinkCookie == TF_INVALID_COOKIE)
return;
if (SUCCEEDED(_pThreadMgr->QueryInterface(IID_ITfSource, (void **) &pSource)))
{
pSource->UnadviseSink(_dwThreadMgrEventSinkCookie);
pSource->Release();
}
_dwThreadMgrEventSinkCookie = TF_INVALID_COOKIE;
}
示例8: UnadviseSink
void UnadviseSink(IUnknown *pSourceIn, DWORD *pdwCookie)
{
ITfSource *pSource;
if (*pdwCookie == TF_INVALID_COOKIE)
return; // never Advised
if (pSourceIn->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
{
pSource->UnadviseSink(*pdwCookie);
pSource->Release();
}
*pdwCookie = TF_INVALID_COOKIE;
}
示例9: _UninitThreadMgrSink
void CCaseTextService::_UninitThreadMgrSink()
{
ITfSource *pSource;
if (_dwThreadMgrEventSinkCookie == TF_INVALID_COOKIE)
return; // never Advised
if (_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
{
pSource->UnadviseSink(_dwThreadMgrEventSinkCookie);
pSource->Release();
}
_dwThreadMgrEventSinkCookie = TF_INVALID_COOKIE;
}
示例10: _UninitThreadMgrEventSink
void CTextService::_UninitThreadMgrEventSink()
{
HRESULT hr;
if(_dwThreadMgrEventSinkCookie != TF_INVALID_COOKIE)
{
ITfSource *pSource = nullptr;
if(SUCCEEDED(_pThreadMgr->QueryInterface(IID_PPV_ARGS(&pSource))) && (pSource != nullptr))
{
hr = pSource->UnadviseSink(_dwThreadMgrEventSinkCookie);
SafeRelease(&pSource);
}
_dwThreadMgrEventSinkCookie = TF_INVALID_COOKIE;
}
}
示例11: _UnadviseTextLayoutSink
HRESULT CCandidateList::_UnadviseTextLayoutSink()
{
HRESULT hr = E_FAIL;
if(_pContextDocument != NULL)
{
ITfSource *pSource;
if(_pContextDocument->QueryInterface(IID_PPV_ARGS(&pSource)) == S_OK)
{
hr = pSource->UnadviseSink(_dwCookieTextLayoutSink);
SafeRelease(&pSource);
}
}
return hr;
}
示例12: _UnadviseContextKeyEventSink
HRESULT CCandidateList::_UnadviseContextKeyEventSink()
{
HRESULT hr = E_FAIL;
ITfSource *pSource;
if(_pContextCandidateWindow != NULL)
{
if(_pContextCandidateWindow->QueryInterface(IID_PPV_ARGS(&pSource)) == S_OK)
{
hr = pSource->UnadviseSink(_dwCookieContextKeyEventSink);
SafeRelease(&pSource);
}
}
return hr;
}
示例13: _UninitThreadMgrEventSink
void CSampleIME::_UninitThreadMgrEventSink()
{
ITfSource* pSource = nullptr;
if (_threadMgrEventSinkCookie == TF_INVALID_COOKIE)
{
return;
}
if (SUCCEEDED(_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource)))
{
pSource->UnadviseSink(_threadMgrEventSinkCookie);
pSource->Release();
}
_threadMgrEventSinkCookie = TF_INVALID_COOKIE;
}
示例14: _UninitActiveLanguageProfileNotifySink
void COVTSF::_UninitActiveLanguageProfileNotifySink()
{
ITfSource* pSource = nullptr;
if (_activeLanguageProfileNotifySinkCookie == TF_INVALID_COOKIE)
{
return; // never Advised
}
if (_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource) == S_OK)
{
pSource->UnadviseSink(_activeLanguageProfileNotifySinkCookie);
pSource->Release();
}
_activeLanguageProfileNotifySinkCookie = TF_INVALID_COOKIE;
}
示例15: _UninitThreadFocusSink
void CIME::_UninitThreadFocusSink()
{
ITfSource* pSource = nullptr;
if (FAILED(_pThreadMgr->QueryInterface(IID_ITfSource, (void **)&pSource)))
{
return;
}
if (FAILED(pSource->UnadviseSink(_dwThreadFocusSinkCookie)))
{
pSource->Release();
return;
}
pSource->Release();
}