ITfSource::AdviseSink method (msctf.h)

Installs an advise sink.

Syntax

HRESULT AdviseSink(
  [in]  REFIID   riid,
  [in]  IUnknown *punk,
  [out] DWORD    *pdwCookie
);

Parameters

[in] riid

Identifies the type of advise sink to install.

This parameter can be one of the following values when the ITfSource object is obtained from an ITfThreadMgr object.

This parameter can be one of the following values when the ITfSource object is obtained from an ITfContext object.

Value Meaning
IID_ITfActiveLanguageProfileNotifySink
Installs an ITfActiveLanguageProfileNotifySink advise sink.
IID_ITfDisplayAttributeNotifySink
Installs an ITfDisplayAttributeNotifySink advise sink.
IID_ITfKeyTraceEventSink
Installs an ITfKeyTraceEventSink advise sink.
IID_ITfPreservedKeyNotifySink
Installs an ITfPreservedKeyNotifySink advise sink.
IID_ITfThreadFocusSink
Installs an ITfThreadFocusSink advise sink.
IID_ITfThreadMgrEventSink
Installs an ITfThreadMgrEventSink advise sink.

[in] punk

The advise sink IUnknown pointer.

[out] pdwCookie

Address of a DWORD value that receives an identifying cookie. This value is used to uninstall the advise sink in a subsequent call to ITfSource::UnadviseSink. Receives (DWORD)-1 if a failure occurs.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_INVALIDARG
One or more parameters are invalid.
CONNECT_E_CANNOTCONNECT
The advise sink cannot be installed.
CONNECT_E_ADVISELIMIT
The maximum number of advise sinks has been reached.
E_FAIL
An unspecified error occurred.
E_OUTOFMEMORY
A memory allocation failure occurred.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header msctf.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

ITfActiveLanguageProfileNotifySink

ITfCompartment

ITfCompartmentEventSink

ITfContext

ITfContextKeyEventSink

ITfDisplayAttributeNotifySink

ITfEditTransactionSink

ITfInputProcessorProfiles

ITfKeyTraceEventSink

ITfLangBarItem

ITfLangBarItemSink

ITfLanguageProfileNotifySink

ITfPreservedKeyNotifySink

ITfSource

ITfSource::UnadviseSink

ITfStatusSink

ITfSystemLangBarItemSink

ITfTextEditSink

ITfTextLayoutSink

ITfThreadFocusSink

ITfThreadMgr

ITfThreadMgrEventSink