Applies to: desktop apps | Metro style apps
The ITfCompartment interface is implemented by the TSF manager and is used by clients (applications and text services) to obtain and set data in a TSF compartment.
A client also uses this interface to obtain an ITfSource interface that is used to install an ITfCompartmentEventSink compartment change notification sink. The client calls ITfCompartment::QueryInterface with IID_ITfSource to obtain the ITfSource interface.
Members
The ITfCompartment interface inherits from the IUnknown interface. ITfCompartment also has these types of members:
Methods
The ITfCompartment interface has these methods.
| Method | Description |
|---|---|
| GetValue |
Obtains the data for a compartment. |
| SetValue |
Sets the data for a compartment. |
Examples
ITfCompartment
HRESULT hr;
VARIANT var;
VariantInit(&var);
hr = m_pCompartment->GetValue(&var);
if(S_OK == hr)
{
switch(var.vt)
{
case VT_I4:
long lValue = var.lVal;
break;
}
VariantClear(&var);
}
ITfSourceITfCompartmentITfCompartmentEventSink
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();
}
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Redistributable | TSF 1.0 on Windows 2000 Professional |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 2/15/2012