locked
Spell Check? RRS feed

  • Question

  • Hi Folks:

       Developing on Win 8.1 Pro, VS 2010 Pro, WIN32 no MFC. 

       My rich text control stuff is starting to work, thanks for your assistance. 

       Now I want to add nice full featured spell checking, like MS Word has. 

       I can't expect users to have MS Office, or any other app, installed on their PC. 

       I found this:

          http://blogs.msdn.com/b/murrays/archive/2012/08/31/richedit-spell-checking-autocorrection-and-prediction.aspx

       The article suggests that Win 8 introduces some built in spell check features. 

       This article has some examples, but my build isn't finding IMF_SPELLCHECKING.  My OS is new enough, but it looks like the Richedit.h shipped with VS 2010 is lacking. 

       There are a lot of people using Win 7, and it would be nice to be able to offer them spell checking. 

       I see there are 3rd party spell checkers available.  What are you people using?

       Another, related, issue.  The article makes a reference to msftedit.dll, which is used by rich text 4.1.  I use the Resource Editor to lay out my dialogs and the only rich text control in the VS2010 editor's toolbox is rich text 2.0.  Rich text 4.1 shipped with Windows XP and Vista. 

       I know I can create my own rich text edit control window by hand, but why isn't a more current version of the rich text control available with VS2010's Resource Editor? 

          Thanks
          Larry


    Wednesday, September 24, 2014 5:23 AM

Answers

  • Hi Larry,

    Thanks for posting in MSDN forum.


    I have read the blog which introduced some built-in spell check features in the rich edit control. It is a pity that  the spell check feature is only supported in window store app in windows 8. 


    =>”I see there are 3rd party spell checkers available.  What are you people using?”

    I find this which is not  a 3rd party spell checker, although working with MFC(maybe you don’t need), it may inspire you to use MS  Word Automation to you win32 program.

    http://www.codeproject.com/Articles/9487/Adding-Spell-Check-and-Synonym-Info-to-a-Text-Edit


    =>”but why isn't a more current version of the rich text control available with VS2010's Resource Editor? ”

    For this question, I think there are some compatibility and security issues, maybe you could find the answer or have your own understanding from this blog,  Some RichEdit History .

    Best regards,

    Shu Hu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Shu 2017 Monday, October 6, 2014 7:57 AM
    Thursday, September 25, 2014 7:01 AM

All replies

  • Hi Larry,

    Thanks for posting in MSDN forum.


    I have read the blog which introduced some built-in spell check features in the rich edit control. It is a pity that  the spell check feature is only supported in window store app in windows 8. 


    =>”I see there are 3rd party spell checkers available.  What are you people using?”

    I find this which is not  a 3rd party spell checker, although working with MFC(maybe you don’t need), it may inspire you to use MS  Word Automation to you win32 program.

    http://www.codeproject.com/Articles/9487/Adding-Spell-Check-and-Synonym-Info-to-a-Text-Edit


    =>”but why isn't a more current version of the rich text control available with VS2010's Resource Editor? ”

    For this question, I think there are some compatibility and security issues, maybe you could find the answer or have your own understanding from this blog,  Some RichEdit History .

    Best regards,

    Shu Hu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Shu 2017 Monday, October 6, 2014 7:57 AM
    Thursday, September 25, 2014 7:01 AM
  • Thanks Shu Hu:

       Is that blog saying that if I send a rich text control an EM_SETLANGOPTIONS and an EM_SETEDITSTYLE message I have a full featured spell checker? 

       Where does the library come from? 

       Doesn't a spell checker require language rules and dozens of other processes a user doesn't even think about? 

       Do two SendMessage() calls with some easily constructed arguments, provide all of the features of a spell checker like the one in MS Word, or this forum? 

       It looks like this requires rich text version 4.1 or above, is that correct? 

       Do newer versions of Visual Studio, after VS 2010, ship with  Richedit.h that define constants I found missing? 

       Is there an update to VS 2010 that would provide me with this functionality?  Visual Studio isn't cheap, and I believe the time is approaching when a new version will be available.  I'd prefer to save my money for that. 

       "RichEdit has provided support for client spell checking (TOM object model and temporary character formatting—see tomApplyTmp) and autocorrect (see EM_SETAUTOCORRECTPROC) for many years. But it has been the RichEdit client’s responsibility to access the spell-checking and autocorrection components"

       I've never heard of TOM, but I'll study it now.  Can you direct me to an example that uses this technology to build a spell checker for a rich text control using C++?   

       I've found that diving into unfamiliar technologies in pursuit of a particular goal can lead to a wide and frustrating search.  Any resource that can help narrow my focus on a spell checker would be appreciated. 

       I'm grateful for your response.

          Thanks
          Larry






    Thursday, September 25, 2014 7:37 PM
  • Word et al all use a 3rd party spell checker. To add a spell checker is not trivial as it requires a sophisticated level understanding of lang=en_us or other tongue.

    Microsoft simply licensed it for Word, Google developed their own technology that they use with Chrome to help with web forms etc.

    This very forum is a database and a web forms application


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    Seagate ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier!

    Hardcore Games Legendary is the Only Way to Play!

    Thursday, September 25, 2014 8:39 PM
  • The article suggests that Win 8 introduces some built in spell check features. 

    This article has some examples, but my build isn't finding IMF_SPELLCHECKING

    My OS is new enough, but it looks like the Richedit.h shipped with VS 2010 is lacking. 

    Why would you expect a compiler which was released *before* a particular version of Windows
    to include support for features only added in that later Win version? VS 2010 was released
    about two years before Win 8 was released, so it's not surprising that it doesn't have
    support for features which first appeared in Win 8.

    Supported Platforms (Visual C++)
    Visual Studio 2010
    http://msdn.microsoft.com/en-us/library/ms235435%28v=vs.100%29.aspx

    EM_GETLANGOPTIONS message
    http://msdn.microsoft.com/en-us/library/windows/desktop/bb788040%28v=vs.85%29.aspx

    Excerpt:

    ==========================
    IMF_SPELLCHECKING

    Windows 8: If this flag is set, the rich edit control turns on spell checking.
    This option is turned off by default (0).

    ==========================

    - Wayne

    Thursday, September 25, 2014 9:42 PM
  • Thanks Vegan Fanatic:

       I do understand that there is a lot behind a spell checker, both the most basic set of functions any spell checker for any language would need and an equally daunting collection of tasks required by each language it supports. 

      But solving complex issues is how IT professionals like us make a living. 

       And what user of our software wouldn't want a full featured spell checker when entering text?

       The blog referenced in my original post seems to suggest an impressively simple solution to the problem.  Set some flags in some arguments, a couple of SendMessage() statements, and, "To my delight, my typing was proofed and autocorrected very nicely!" 

       Is it really this simple if I get a new version of Visual Studio with support for newer features of rich text controls?  This solution would, presumably, require the user to be running Windows 8.  Not as inclusive as I'd like, but if it's that easy I'm interested. 

       If I'm totally misinterpreting the referenced blog, can you recommend a 3rd party spell checker for C++ applications?  A package where some smart and enterprising person has solved the issues needed to provide a full featured spell checker for a rich text control?  Perhaps I'll want other languages some day, but for now English support would be fine. 

          Thanks
          Larry

        After posting this I came upon:

          http://visualstudiomagazine.com/articles/2013/08/01/using-the-c-spell-checking-api.aspx

       It starts with this intriguing  sentence:

       "Did you know that Windows includes a native Spell Checking API designed for C++ developers?"

       The utility I've built to support my first rich text control is doing everything I need for font's and text colors.  I need to wrap up this portion of the app and get it into the hands of my client for testing.  

       Then I'll pursue the addition of spell checking. 

       Thanks to all who help developers like me in this forum. 


    Thursday, September 25, 2014 10:12 PM
  • today there are some open source spell checkers you can investigate 

    of course you can ace English like I did at university

    who gets and A in English? I did!


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    Seagate ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier!

    Hardcore Games Legendary is the Only Way to Play!

    Thursday, September 25, 2014 10:26 PM
  •    Then I'll pursue the addition of spell checking.

    Also see:

    GNU Aspell
    http://aspell.net/

    "GNU Aspell is a Free and Open Source spell checker"

    - Wayne

    Thursday, September 25, 2014 10:38 PM
  • Also see:

    Hunspell
    http://hunspell.sourceforge.net/

    "Hunspell is the spell checker of LibreOffice, OpenOffice.org, Mozilla Firefox 3 & Thunderbird,
    Google Chrome, and it is also used by proprietary software packages, like Mac OS X, InDesign,
    memoQ, Opera and SDL Trados."

    "C++ library under GPL/LGPL/MPL tri-license."

    - Wayne
    Thursday, September 25, 2014 10:43 PM
  • With respect to Hunspell, note especially:

    http://sourceforge.net/projects/hunspell/files/Misc/RichEdit/

    "The purpose of this module is hook into any RichEdit control for spell checking, whether
    the application has been written in C, C++ or uses MFC."

    - Wayne
    Thursday, September 25, 2014 11:06 PM
  • Why would you expect a compiler which was released *before* a particular version of Windows

    to include support for features only added in that later Win version? VS 2010 was released
    about two years before Win 8 was released, so it's not surprising that it doesn't have
    support for features which first appeared in Win 8.

       I'm sorry, I didn't word my original post more carefully. 

       Of course I wouldn't expect VS 2010 to ship with features that wouldn't exist in the OS for several years. 

       I was expecting that as new features are added to new versions of the OS updates to the development system might include header files that unlock them.  That's the point of, "My OS is new enough, but it looks like the Richedit.h shipped with VS 2010 is lacking."

    Friday, September 26, 2014 12:42 AM

  • I was expecting that as new features are added to new versions of the OS updates to the development system might include header files that unlock them. 

    New features aren't added "piecemeal" but usually only via Service Packs, such as:

    Description of Visual Studio 2010 Service Pack 1
    http://support.microsoft.com/kb/983509

    But support for entire new versions of Windows requires new versions of VS.
    Win 8 support was added in VS 2012, as shown here:

    Supported Platforms (Visual C++)
    Visual Studio 2012
    http://msdn.microsoft.com/en-us/library/ms235435%28v=vs.110%29.aspx

    On the topic of spell checking, if you can use the .NET framework in your application, see:

    SpellCheck Class
    .NET Framework 4
    http://msdn.microsoft.com/en-us/library/system.windows.controls.spellcheck%28v=vs.100%29.aspx

    "Provides real-time spell-checking functionality to text-editing controls, such as TextBox
    and RichTextBox."

    - Wayne

    Friday, September 26, 2014 2:59 AM
  • The article makes a reference to msftedit.dll, which is used by rich text 4.1.

    I know I can create my own rich text edit control window by hand, ...

    This tip might come in handy at some point:

    How do I use RichEdit 4.1?
    http://blogs.msdn.com/b/tsfaware/archive/2007/06/14/how-do-i-use-richedit-4-1.aspx

    - Wayne

    Friday, September 26, 2014 3:18 AM