Проверка орфографии WPF вызывает исключения на некоторых машинах - PullRequest
0 голосов
/ 15 января 2019

У меня есть приложение, использующее проверку орфографии в WPF.По большей части это работает отлично, но у меня есть некоторые пользователи, которые получают исключения, такие как:

Retrieving the COM class factory for component with CLSID {7AB36653-1796-484B-BDFA-E74F1DB7C1DC} failed due to the following error: 8007045a A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)...

Вот стек:

   at MS.Internal.ReaderWriterLockSlimWrapper.ExecuteWithinLockInternal(Action lockAcquire, Action lockRelease, Object& result, Delegate criticalAction, Object[] args)
   at MS.Internal.ReaderWriterLockSlimWrapper.WithWriteLock[T1,T2,TResult](Func`3 criticalAction, T1 arg1, T2 arg2, TResult& result)
   at System.Windows.Documents.MsSpellCheckLib.SpellCheckerFactory.Create(Boolean shouldSuppressCOMExceptions)
   at System.Windows.Documents.WinRTSpellerInterop..ctor()
   at System.Windows.Documents.SpellerInteropBase.CreateInstance()
   at System.Windows.Documents.Speller.EnsureInitialized()
   at System.Windows.Documents.Speller.SetCustomDictionaries(CustomDictionarySources dictionaryLocations, Boolean add)
   at System.Windows.Documents.TextEditor.SetCustomDictionaries(Boolean add)
   at System.Windows.Controls.SpellCheck.OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.Controls.TextBox.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at RDES.KeynoteManager.KMCore.KeynoteData.UC_KeynoteFile.TextBox_Loaded(Object sender, RoutedEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Я посмотрел этот ключ в моем реестре, и оннаходится в папке Computer \ HKEY_CLASSES_ROOT \ Wow6432Node \ CLSID {7AB36653-1796-484B-BDFA-E74F1DB7C1DC} \ InProcServer32, а ключ по умолчанию сопоставлен с C: \ Windows \ SysWOW64 \ MsSpellCheckingFacility.dll из 100 * * 7 *., кажется, что происходит сбой, когда проверка правописания включена в текстовом поле.Есть два режима, в которых проверка правописания может быть включена в приложении, вот строки кода, где это происходит:

tbSpell.SpellCheck.IsEnabled =
                    KMApplication.Settings.ForceSpellingMode != SpellChecker.SpellingModes.None;

и

var bnd = new Binding("EnableSpelling");
tb.SetBinding(SpellCheck.IsEnabledProperty, bnd);

ОС, на которой я работаю, иОС последнего пользователя, получившего это исключение, - это Win 10 x64.Что может вызывать случайную ошибку?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...