From 6665a3ae94262b6244f44fa45e4cd6ece55ee1e8 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Thu, 26 Oct 2023 15:57:35 +0600 Subject: [PATCH] Add support for runtimes without built-in COM interop --- ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs b/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs index b7033c4c..3e468087 100644 --- a/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs +++ b/ICSharpCode.AvalonEdit/Editing/ImeNativeWrapper.cs @@ -116,7 +116,14 @@ public static ITfThreadMgr GetTextFrameworkThreadManager() { if (!textFrameworkThreadMgrInitialized) { textFrameworkThreadMgrInitialized = true; - TF_CreateThreadMgr(out textFrameworkThreadMgr); + try + { + TF_CreateThreadMgr(out textFrameworkThreadMgr); + } + catch + { + // The call will fail if the current runtime doesn't have COM interop + } } return textFrameworkThreadMgr; }