简体   繁体   中英

Cannot get ITfThreadMgrEx on my XP Professional System

I came across a problem with my XP Professional System while working with Text Services Framework. I want to get the ITfThreadMgrEx interface from ITfThreadMgr. According to Microsoft, ITfThreadMgr.QueryInterface() is used to get ITfThreadMgrEx. When I tried this in C++, I got back E_NOINTERFACE. According to Microsoft, ITfThreadMgrEx is available on Windows 2000 TSF 1.0. So I just naturally assumed it would be available on XP Professional.

Also, I have tried this program on Windows 7, no problem. Yet on two different Windows XP Professional SP3 with international language far east language support installed, the same problem on both systems.

Is there anyone familiar with TSF enough to know why I am not able to get the interface according to Microsoft's documentation? Any ideas on what I can try?

HRESULT hr = ::CoInitialize(NULL);
ITfThreadMgr * p = NULL;
ITfThreadMgrEx * pe = NULL;
hr = ::CoCreateInstance(CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC, IID_ITfThreadMgr, (void**)&p);
hr = p->QueryInterface(IID_ITfThreadMgrEx, (void**)&pe);

UPDATE: I can get the ITfThreadMgr interface once I install the far east languages and add Chinese (PRC) to the language bar (Regional and Language in the control panel). I can get this interface using the CoCreateInstance() and also the TF_CreateThreadMgr().

But for some reason the interfaces that are QI'd from ITfThreadMgr that are directly related to customizing the UI components of the TIP are not available. I can get other interfaces from ITfThreadMgr.QueryInterface, such as ITfClientId and ITfMessagePump, but I cannot get ITfUIElementMgr nor ITfThreadMgrEx.

It is like the feature to custom draw the TIP UI is simply not installed or enabled. But I am not certain if that is even the correct direction to look in.

ITfThreadMgrEx and ITfUIElementMgr are only available on Vista and above. MSDN's documentation here is just wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM