Trying to Activate the UI-Thread which is in Multithreaded Apartment, but it seems the call to ITfThreadMgr->Activate has no effect.
Trying to Activate the UI-Thread which is in Multithreaded Apartment, but it seems the call to ITfThreadMgr->Activate has no effect.
For debugging purposes I suggest you change from an assignment to ATL's CComQIPtr (which doesn't return an HRESULT upon failure) to a conventional call to QueryInterface to provide some more diagnostic information. Alternatively, you could step through the ATL internals to determine the HRESULT of the failed QueryInterface call.

It says No_Interface, but in STA Thread, it returns right item
Maybe you need to obtain the interface pointer in an STA thread and marshal it to you MTA thread.
Since the instance of ITfThreadMgr created by CoCreateInstance only for Apartment Thread, you should use TF_CreateThreadMgr to create a threadMgr that can be used in both Apartment Thread and MultiThreaded Thread.
https://docs.microsoft.com/en-us/windows/win32/api/msctf/nf-msctf-tf_createthreadmgr
8 people are following this question.