Wintertree Software Inc.

WSpell ActiveX Spelling Checker

Home Site index Contact us Catalog Shopping Cart Products Support Search

You are here: Home > Support > WSpell > Mapping text control class names


Mapping text control class names

Problem: When checking a text control using WSpell's TextControlHWnd property, misspelled words in the control are not highlighted correctly or replacements are not made correctly when misspelled words are corrected. For example, highlighting might start before the misspelled word and end in the middle of it.

Discussion: WSpell communicates with text controls to highlight words, replace words, and obtain the text by sending messages to the control. The type and format of the messages varies depending on the control type. To determine the type of control, WSpell checks its window class name (a name assigned by the control creator). If WSpell knows the control's window class name, messages it sends to the control will be correct and no problems will occur. However, if the class name is unknown to WSpell, it will attempt to "guess" the type of control. Sometimes WSpell will guess incorrectly and various problems can arise. WSpell knows the class names of controls which are part of the Windows common controls (i.e., which are part of the Windows operating system). Sometimes, new controls with additional behavior are created from existing common controls. WSpell can deal with these controls, but doesn't know how to because their window class names are unknown. This document describes a way to tell WSpell which underlying common control a new control is based on.

Solution:

The solution is to map the new control's window class name to the class name of the underlying common control. To do this you will need two pieces of information: 1) The window class name of the control you are using; 2) the window class name of the common control on which your control is based. The people who support your development environment should be able to provide this information.

To define the map, create a string value in the following tree in the system registry:

HKEY_LOCAL_MACHINE\Software\Wintertree\WSpell

Give the string value the same name as the new control's window class name. Set the value to the class name of the underlying common control. For example, if the new control's window class name is "ATL:SAP TextEditBody", and that control is based on the RichEdit20A common control, create a string value like this:

ATL:SAP TextEditBody = "RichEdit20A"

Note that you will need to create this string value in the registry on all systems on which your application is installed.

If the control is not based on an underlying common control, see Using WSpell with a third-party edit control for help.


Home Site index Contact us Catalog Shopping Cart Products Support Search


Copyright © 2015 Wintertree Software Inc.