{"record":{"id":"9c93245f9530be8f","repo":"dotnet/wpf","slug":"0x80004001","errorCode":"0x80004001","errorMessage":"SR.TextStore_E_NOTIMPL","messagePattern":"SR\\.TextStore_E_NOTIMPL","errorType":"error_code","errorClass":"COMException","httpStatus":null,"severity":"warning","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextStore.cs","lineNumber":545,"sourceCode":"            }\n            finally\n            {\n                // Closes compsotion undo unit with commit to add the composition undo unit into the undo stack.\n                CloseTextParentUndoUnit(unit, undoCloseAction);\n            }\n\n            if (IsTracing)\n            {\n                IMECompositionTracer.Trace(this, IMECompositionTraceOp.ESetText,\n                                            \"change:\", change.start, change.oldEnd, change.newEnd);\n            }\n        }\n\n        // See msdn's ITextStoreACP documentation for a full description.\n        public void GetFormattedText(int startIndex, int endIndex, out object obj)\n        {\n            obj = null;\n            throw new COMException(SR.TextStore_E_NOTIMPL, unchecked((int)0x80004001));\n        }\n\n        // See msdn's ITextStoreACP documentation for a full description.\n        public void GetEmbedded(int index, ref Guid guidService, ref Guid riid, out object obj)\n        {\n            obj = null;\n\n#if ENABLE_INK_EMBEDDING\n            ITextPointer textPosition;\n\n            if (index < this.TextContainer.IMECharCount)\n            {\n                // Create a position just following the index and look backward.\n                // CreatePointerAtCharOffset always returns a pointer adjacent\n                // to the lowest symbol offset matching a given char offset.\n                textPosition = CreatePointerAtCharOffset(index + 1, LogicalDirection.Forward);\n\n                if (textPosition.GetPointerContext(LogicalDirection.Backward) == TextPointerContext.EmbeddedElement)","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextStore.cs#L527-L563","documentation":"TextStore.GetFormattedText (ITextStoreACP::GetFormattedText) is not implemented by WPF's TSF text store; it always throws a COMException with E_NOTIMPL (0x80004001) after setting the out parameter to null. The TSF interface member exists for embedded-format retrieval, which WPF does not support.","triggerScenarios":"Any text service or TSF client calling ITextStoreACP::GetFormattedText on a WPF TextStore, regardless of arguments or state.","commonSituations":"Custom text services or TSF-based automation probing supported interface members; ported Win32 text-service code assuming full ITextStoreACP support.","solutions":["Do not call GetFormattedText on WPF text stores; use GetText instead.","In the text service, treat E_NOTIMPL as 'capability absent' and fall back to GetText/plain text.","Query supported functionality before invoking optional interface members."],"exampleFix":"// before\nstore.GetFormattedText(start, end, out obj);\n// after: use plain text\nstring text = null; store.GetText(start, end, 0, null, out text, out change);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { store.GetFormattedText(start, end, out obj); } catch (COMException ex) when (ex.ErrorCode == unchecked((int)0x80004001)) { /* fall back to GetText */ }","preventionTips":["Treat GetFormattedText as unimplemented in WPF TSF","Always provide a GetText fallback path","Probe optional ITextStoreACP members defensively"],"tags":["wpf","tsf","not-implemented","unsupported-api"],"backgroundTag":"method-not-implemented","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}