microsoft-ui-xaml: CoreTextServicesManager.GetForCurrentView() throws exceotion in WinUI3 for Desktop preview 4

When running the following code

var manager = CoreTextServicesManager.GetForCurrentView();

The following exception is thrown

System.Runtime.InteropServices.COMException: ‘The application called an interface that was marshalled for a different thread. (0x8001010E (RPC_E_WRONG_THREAD))’

The calling thread is the ui thread. Looks like a bug.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 16 (3 by maintainers)

Most upvoted comments

The exception is no longer thrown, but the TextUpdating event is not raised for English keyboard. is this expected?

Ah, thanks @arivoir – turns out this is only working in insider Windows builds, unfortunately all the shipping versions of Windows are failing in the way you’ve mentioned. We’ll add this to the list. Sorry for the oversight and thanks for letting us know.

As of preview 4 api’s which require a core window now throw, these are largely the API’s that have CurrentView in their title likeGetForCurrentView() @anawishnoff Do we have documentation for this issue? It is strange that we are throwing a wrong thread exception… @Austin-Lamb Should we look at the exception we throw for this?