|
DestroyHRC
Generally, the life of an HRC object is brief. An application destroys the HRC after obtaining results from the recognizer and creates a new HRC at the start of the next input session.
In the model described above, CreateCompatibleHRC calls GlobalAlloc to allocate system memory in which the HRC object resides. The function returns a pointer to the fixed allocation as an HRC handle.
DestroyHRC reverses the action, using the original HGLOBAL handle to free the allocated memory. When DestroyHRC successfully returns, the HRC handle is no longer valid. The application should set the handle to NULL to
prevent accidental reuse, as described in "Destroying the HRC" in Chapter 5.
int WINAPI DestroyHRC( HRC hrc )
{
LPHRCinternal lphrc = (LPHRCinternal) hrc; // Pointer to HRC
if (!GlobalUnlock( lphrc->hglobal ))
return HRCR_OK;
else
return HRCR_ERROR;
}
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
|