This article discusses an issue where the CoInitializeEx function fails after calling the HtmlHelp function on the same thread.
Applies to: All supported operating system
Symptoms
If an application calls HtmlHelp before calling CoInitializeEx with the specified COINIT_MULTITHREADED value, CoInitializeEx can return RPC_E_CHANGED_MODE (0x80010106). As a result, the application might crash, hang, or display unexpected behavior.
Cause
If a thread that calls HtmlHelp isn't initialized with CoInitialize or CoInitializeEx, HtmlHelp initializes the thread as apartment-threaded with COINIT_APARTMENTTHREADED.
Workaround
To work around the issue and avoid the conflict of COM initialization on a single thread, create a new thread and call HtmlHelp on that thread.
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors (upstream author metadata: hihayak). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
