Text Services Framework
ITfCompartmentEventSink
The ITfCompartmentEventSink interface is implemented by a client (application or text service) and used by the TSF manager to notify the client when compartment data changes. This notification sink is installed by obtaining an
ITfSource interface from the
ITfCompartment object and calling
ITfSource::AdviseSink with IID_ITfCompartmentEventSink and a pointer to the ITfCompartmentEventSink object.
Methods in Vtable Order
The ITfCompartmentEventSink interface inherits the methods of the standard COM interface IUnknown.
In addition, ITfCompartmentEventSink defines the following method.
| ITfCompartmentEventSink method | Description |
| OnChange | Called when compartment data changes. |
Example Code
[C++]
The following code example demonstrates how to obtain an
ITfSource interface from an
ITfCompartment object and install an
ITfCompartmentEventSink notification sink.
HRESULT hr;
ITfSource *pSource;
hr = m_pCompartment->QueryInterface(IID_ITfSource,
(LPVOID*)&pSource);
if(SUCCEEDED(hr))
{
hr = pSource->AdviseSink(IID_ITfCompartmentEventSink,
(ITfCompartmentEventSink*)this,
&m_dwCookie);
pSource->Release();
} Windows NT/2000/XP: Included in Windows XP.
Redistributable: Requires TSF 1.0 on Windows NT 4.0; Windows 2000; and Windows 98/Me.
Header: Declared in Msctf.idl and Msctf.h.
Library: Included as a resource in Msctf.dll.