1 //#define TSF_DEBUG_OUTPUT
5 using System.Diagnostics;
6 using System.Reflection;
7 using System.Runtime.InteropServices;
8 using System.Globalization;
10 using DotNetTextStore.UnmanagedAPI.TSF;
11 using DotNetTextStore.UnmanagedAPI.TSF.TextStore;
12 using DotNetTextStore.UnmanagedAPI.WinDef;
13 using DotNetTextStore.UnmanagedAPI.WinError;
15 namespace DotNetTextStore
17 public sealed class TextStore2 : TextStoreBase, IDisposable, ITextStoreACP2, ITfContextOwnerCompositionSink
23 GC.SuppressFinalize(this);
26 protected override void CreateThreadMgr()
28 if (_threadMgr == null)
30 Type clsid = Marshal.GetTypeFromCLSID(TfDeclarations.CLSID_TF_ThreadMgr);
31 ITfThreadMgr2 threadMgr = Activator.CreateInstance(clsid) as ITfThreadMgr2;
33 if (threadMgr == null)
35 const string message = "スレッドマネージャーの生成に失敗しました。";
36 Debug.WriteLine(message);
37 throw new COMException(message, HRESULT.E_NOTIMPL);
40 this._threadMgr = threadMgr;