|
Recognition Functions
The following sections provide fragmentary examples of the recognition
functions AddPenInputHRC, CreateCompatibleHRC, CreateInksetHRCRESULT, CreatePenDataHRC, and DestroyHRC.
For purposes of discussion, the examples assume the recognizer's HRC takes the form of a private structure called HRCinternal. This structure contains a handle to an HPENDATA block, which stores the stroke information and pen data points for an input
session. (For a description of HPENDATA, see "The HPENDATA Object" in Chapter 4.) The HRC applies only to a single session say, a word written by the user. The client application must create a new HRC to recognize the next word.
The following typedef statement defines the hypothetical HRC object used by the example code fragments in this section:
typedef struct
{
DWORD reserved; // Reserve first DWORD for system
HGLOBAL hglobal; // Handle from GlobalAlloc
HPENDATA hpendata; // HPENDATA handle for input
int wPdk; // Current stroke is pen-up or down
// Other information for the HRC
.
.
} HRCinternal, FAR *LPHRCinternal;
Notice that the structure reserves the first DWORD for system use. This is
required for all recognizer objects. The structure also groups pertinent variables
within the object itself instead of allocating them as global data. This
ensures that the object remains private to the client that creates it.
In the code that follows, all internal functions have an "N" prefix. This
helps distinguish them from standard API functions.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|