Home   Index   About
Ultimate Pack


Custom Search
Getting Results from the RCRESULT Structure

Note The RCRESULT structure is supported only for backward compatibility. It may not exist in future versions of the Pen API. Applications should obtain recognition results through the API functions described in this chapter, rather than from an RCRESULT structure.

The RCRESULT structure applies only when an application calls either of the version 1.0 recognition functions, Recognize or RecognizeData. In this case, the system sends a WM_RCRESULT message to the application. The wParam of this message contains a REC_ submessage that indicates why recognition ended. The lParam of WM_RCRESULT points to an RCRESULT structure, which contains all the results of the recognition.

An application can retrieve from the RCRESULT structure all the recognizer's guesses by walking through the list, called the symbol graph, contained in the RCRESULT structure.

The RCRESULT structure identifies the recognizer's "best guess," which is the guess in which the recognizer places the most confidence. With this information, an application can conveniently retrieve an ASCII string of the best guess by calling SymbolToCharacter:

char szBestGuess[MAX_CHAR]; // ASCII string of best guess

.

.

.

switch (wMsg)

{

case WM_RCRESULT:

SymbolToCharacter(

(LPSYV) ((LPRCRESULT)lparam)->lpsyv, // Symbol string

MAX_CHAR, // Maximum length

(LPSTR) szBestGuess, // Buffer for ASCII

NULL ); // Don't need count

Compare the above call to SymbolToCharacter with the previous example. Here, the second argument represents a maximum, rather than the actual length of the symbol string, which is the value

(int) ((LPRCRESULT)lparam)->cSyv

By specifying the length of the buffer that receives the ASCII text, the second argument sets a cap on the number of symbols SymbolToCharacter will convert. This prevents the function from overflowing the szBestGuess buffer if the length of the symbol string happens to be larger than MAX_CHAR. SymbolToCharacter returns when it encounters SYV_NULL at the end of the symbol string or when it converts MAX_CHAR symbols, whichever occurs first.

An application that calls Recognize or RecognizeData must be prepared to receive WM_RCRESULT messages before calling either function. This is because the recognizer dispatches all WM_RCRESULT messages associated with a particular recognition event before Recognize or RecognizeData returns.

Version 2.0 of the Pen API provides, through function calls, all the information contained in an RCRESULT structure. An application need not examine the structure at all. RCRESULT is a product of recognition, and is therefore of more interest to the recognizer developer than the application developer. Consequently, it is described in more detail in Chapter 8, "Writing a Recognizer."


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun