Laden...

FindFamilyName wirft ConvertHresultToException auf nur einer Maschine

Erstellt von oehrle vor 3 Jahren Letzter Beitrag vor 3 Jahren 625 Views
O
oehrle Themenstarter:in
461 Beiträge seit 2009
vor 3 Jahren
FindFamilyName wirft ConvertHresultToException auf nur einer Maschine

Hallo liebe Community, seit gestern habe ich ein Problem mit einem WinXP-Rechner. Meine Applikation (läuft auf WinXp / Win7 / Win10 rechnern) bockt an dieser einen Maschine. Alle anderen laufen, auch die anderen WinXP-Rechner. Problem ist, das ich auch kein Remotedebugging machen kann, weil die Maschine so abgesichert ist und unsere IT das nicht zulässt. Ich habe mich nun Schritt für Schritt mit veränderten Debugversionsständen und MessageBox-Ausgabe durchgehangelt, ob soweit irgendwo ein Bug ist, habe aber nichts gefunden. Mit scheint so, sobald die Appliaktion das Hauptfenster darstellen soll, geht was schief. Ich habe zur Sicherheit die Debugversion mit den einzelnen Ausgabemeldungen auch noch auf einer anderen Maschine mit WinXP laufen lassen, die hat dort auch funktioniert.

Der Fehlermeldung nach würde ich denken dass etwas mit den Schriftarten nicht passt. Ich poste hier nun mal die komplette Fehlermeldung, eventuell hat jemand eine Idee, was das nicht genau passt.
Entwickelt wurde die Applikation auf FW 4.0 Client Profile.

Hier die Meldung:

Fehlermeldung: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

mscorlib

Void ThrowExceptionForHRInternal(Int32, IntPtr)

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)
at MS.Internal.Text.TextInterface.FontCollection.FindFamilyName(String familyName, UInt32& index)
at MS.Internal.FontCache.FamilyCollection.LookupFamily(String familyName, FontStyle& fontStyle, FontWeight& fontWeight, FontStretch& fontStretch)
at System.Windows.Media.FontFamily.LookupFontFamilyAndFace(CanonicalFontFamilyReference canonicalFamilyReference, FontStyle& style, FontWeight& weight, FontStretch& stretch)
at System.Windows.Media.FontFamily.FindFirstFontFamilyAndFace(FontStyle& style, FontWeight& weight, FontStretch& stretch)
at System.Windows.Media.Typeface.ConstructCachedTypeface()
at System.Windows.Media.Typeface.get_CachedTypeface()
at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit)
at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs)
at MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded)
at MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
at System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.WrapPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Window.MeasureOverrideHelper(Size constraint)
at System.Windows.Window.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

16.807 Beiträge seit 2008
vor 3 Jahren

Du bekommst einen Fehler; und das ist ConvertHresultToException nach FindFamilyName.
Damit hast Du im Prinzip alle Infos, die Du haben musst; Du musst nur schauen, wieso die Exception von FindFamilyName geworfen wird; und das offenbar, weil der verwendete Font defekt ist (sagen die ersten Google Treffer dazu).

Ich hab Dir Dein Beitrag mit Tags angereichert und den Titel (war Fehlermeldung zeigt keine Fehlermeldung) angepasst.
Bitte in Zukunft selbst beachten. Danke.

O
oehrle Themenstarter:in
461 Beiträge seit 2009
vor 3 Jahren

Hallo, ich habe mal überall wo ich "Courier New" als Schriftart setze, eine try...catch eingefügt.
Ohne Erfolg.

Dann habe ich die Schriftart gegen "Arial" getauscht, gleiches Problem.
Was nun?

5.657 Beiträge seit 2006
vor 3 Jahren

Versuche mal, dieser Anleitung hier zu folgen. Damit löschst du im Grunde den FontCache von WPF.
Wenn das nichts bringt, deaktiviere mal den Service "Windows Presentation Foundation Font Cache".

Weeks of programming can save you hours of planning

4.931 Beiträge seit 2008
vor 3 Jahren

Exception when opening a Form using WPF's ShowDialog zufolge befolge mal die Anweisungen in Error message or high CPU utilization when running a Windows Presentation Foundation (WPF)-based application (teste mal, ob deine Anwendung mit deaktiviertem "Windows Presentation Foundation Font Cache" startet und überprüfe also auch, ob die neueste Version vom Grafikkartentreiber auf der XP-Maschine installiert ist).

O
oehrle Themenstarter:in
461 Beiträge seit 2009
vor 3 Jahren
[gelöst] FindFamilyName wirft ConvertHresultToException auf nur einer Maschine

Hallo, das Problem konnte ich lösen.
Hatte zuerst den Dienst aktiviert, Schriftcachedatei gelöscht, und dann die Applikation nochmals gestartet, das war aber ohne Erfolg.

Erst als ich den Grafikkartentreiber erneut installieren lies, hat es funktioniert. Das steht aber auch so in dem Link von MrSparkle.
Danke für die Hilfe 😉