Pinyin (TSF,IME) Compatibility mode changes to ITfUIElement ?

  • Thread starter Thread starter Oliver_Sradnick
  • Start date Start date
O

Oliver_Sradnick

Guest
Hi, im currently working on integrating TSF into a Game.

So far i where able to turn of the OS rendered Candidate window and receive the events to render it myself.


Im on Microsoft Windows [Version 10.0.19041.388]


But it only works if Pinyin is in Compatibility Mode, otherwise im getting an exception.


Unable to cast COM object of type
'System.__ComObject' to interface type 'TSF.TypeLib.ITfUIElement'. This
operation failed because the QueryInterface call on the COM component
for the interface with IID '{EA1EA137-19DF-11D7-A6D2-00065B84435C}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).'



It seems like ITfUIElement isnt supported in new Pinyin Versions.


The interface im using

[ComImport, Guid("ea1ea137-19df-11d7-a6d2-00065b84435c"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITfUIElement
{
[PreserveSig]
HRESULT GetDescription([Out, MarshalAs(UnmanagedType.BStr)] out string pbstrDescription);
[PreserveSig]
HRESULT GetGUID([Out] out Guid pguid);
[PreserveSig]
HRESULT Show([In, MarshalAs(UnmanagedType.Bool)] bool bShow);
[PreserveSig]
HRESULT IsShown([Out, MarshalAs(UnmanagedType.Bool)] out bool pbShow);
}



I also got another question, did the IMM32/IME changed in 10.0.19041.388 ?

Because i had a working version written in C# and after updating the behaviour changed, the candidate window only appears if i enter more than one character and it has to make sense, like it only appears if i enter "sa"(sakura) or "ni"(nihao).

Continue reading...
 
Back
Top