locked
Feedback for the ISpellChecker API RRS feed

  • Question

  • To Whom It May Concern,

    I have recently integrated spell checking support from the Windows SDK (10.0.16299.0 for reference) to validate strings for our game (Unreal Engine 4.24 based)

    The process encountered a number of issues I would like to provide feedback for, including some recommendations for change.

    1. The spell checking API is only exposed if NTDDI_VERSION is at least Windows 8 (0x602). This seems oddly unnecessary with the structure of COM that should simply fail to return an implementation on any platform that doesn't have COM objects registered. 

    We want our games to operate on as low a platform as possible to ensure we can reach all the players that want to play.

    This constraint seems superfluous.

    2. The spell check API requires COINIT_MULTITHREADED to use add_SpellCheckerChanged, otherwise it just fails without a clear indication of why. It also isn't documented as a requirement at https://docs.microsoft.com/en-us/windows/win32/api/spellcheck/nf-spellcheck-ispellchecker-add_spellcheckerchanged.

    This is particularly awkward as there are a number of components to the game that require apartment threaded so I have to create a thread dedicated to the spell check API and marshal calls to the thread.

    3. User dictionaries. There are a couple of points here:

    a. If I add a user dictionary then calls to Add, Ignore, or Remove don't go to the user dictionary I added, it only goes to the personal dictionary.

    b. There is no interface exposed with adding a user dictionary to be able to modify that user dictionary directly and follow all the other behaviour of how spelling operations (such as triggering the callback on the ISpellCheckerChangedEventHandler interface.

    This is compelling so that all the content creators working on this project can have a shared location to modify a dictionary that gets checked in to source control instead of having to manage that on each user's machine.

    So unless I've missed something, I confess disappointment in this experience using the API.

    Thank you,

    Brent Scriver

    • Xbox, Xbox Live, Xbox 360
    • Mass Effect 1, 2, 3, Dragon Age Inquisition
    • League of Legends
    • Dauntless


    Friday, July 24, 2020 6:14 PM

All replies

  • This post piqued my interest so I put together a Win32 based dialog application to exercise the spell checker interfaces on a Win 8.1 system.

    The main thread of the process entered the STA.  There were no errors obtaining an ISpellChecker interface pointer, and the call to ISpellChecker::add_SpellCheckerChanged for the event handler interface succeeded.

    The ISpellCheckerChangedEventHandler::Invoke method on the handler was called.  Within that method a call to CoGetApartmentType confirmed that the method was called in the Main STA.

    Sunday, July 26, 2020 11:50 AM
  • 2. The spell check API requires COINIT_MULTITHREADED to use add_SpellCheckerChanged, otherwise it just fails without a clear indication of why. It also isn't documented as a requirement at https://docs.microsoft.com/en-us/windows/win32/api/spellcheck/nf-spellcheck-ispellchecker-add_spellcheckerchanged.

    This is particularly awkward as there are a number of components to the game that require apartment threaded so I have to create a thread dedicated to the spell check API and marshal calls to the thread.

    It's not clear what you mean by "...fails without a clear indication of why."

    If a thread in an STA is not pumping messages then the call to add_SpellCheckerChanged can succeed but the handler will NOT be called.

    Monday, July 27, 2020 4:58 PM