{"record":{"id":"98915888ce7989a7","repo":"dotnet/wpf","slug":"0x80004002","errorCode":"0x80004002","errorMessage":"SR.TextStore_E_NOINTERFACE","messagePattern":"SR\\.TextStore_E_NOINTERFACE","errorType":"error_code","errorClass":"COMException","httpStatus":null,"severity":"warning","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextStore.cs","lineNumber":84,"sourceCode":"        //\n        //------------------------------------------------------\n\n        #region ITextStoreACP\n\n        // See msdn's ITextStoreACP documentation for a full description.\n        public void AdviseSink(ref Guid riid, object obj, UnsafeNativeMethods.AdviseFlags flags)\n        {\n            UnsafeNativeMethods.ITextStoreACPSink sink;\n\n            if (riid != UnsafeNativeMethods.IID_ITextStoreACPSink)\n            {\n                throw new COMException(SR.TextStore_CONNECT_E_CANNOTCONNECT, unchecked((int)0x80040202));\n            }\n\n            sink = obj as UnsafeNativeMethods.ITextStoreACPSink;\n            if (sink == null)\n            {\n                throw new COMException(SR.TextStore_E_NOINTERFACE, unchecked((int)0x80004002));\n            }\n\n            // It's legal to replace existing sink.\n            if (HasSink)\n            {\n                Marshal.ReleaseComObject(_sink);\n            }\n            else\n            {\n                // Start tracking window movement for _sink.\n                _textservicesHost.RegisterWinEventSink(this);\n            }\n\n            _sink = sink;\n        }\n\n        // See msdn's ITextStoreACP documentation for a full description.\n        public void UnadviseSink(object obj)","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Documents/TextStore.cs#L66-L102","documentation":"In AdviseSink, after the IID check passes, the object is cast to UnsafeNativeMethods.ITextStoreACPSink; if the cast fails the store throws COMException 0x80004002 (E_NOINTERFACE). The advising object claims the IID but does not actually implement the ACP sink interface.","triggerScenarios":"TSF calling AdviseSink with the correct IID_ITextStoreACPSink but passing an object that does not implement ITextStoreACPSink (queried interface failed on the caller side) during text store connection for a focused text box.","commonSituations":"Faulty TSF text service / IME add-ins with broken QueryInterface; corrupted input service state; mismatched Windows text framework versions.","solutions":["Refocus the text control or restart the app to force a fresh TSF advise cycle","Identify and disable/remove the offending TSF text service or IME add-in","Update Windows/IME to a version whose TSF provider correctly implements ITextStoreACPSink","Environmental on the caller side; app code typically lets the HRESULT propagate to TSF rather than handling it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* text input path */ } catch (COMException ce) when (ce.ErrorCode == unchecked((int)0x80004002)) { RestartTextServicesOrRefocus(); }","preventionTips":["Avoid broken TSF providers; keep IME packs current","Refocus/recreate controls after sink failures","Log COMExceptions in input paths for diagnosing faulty add-ins"],"tags":["com","tsf","ime","wpf"],"backgroundTag":"unsupported-operation","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"}