DTWAIN_EnumOCRInterfaces |
Top Previous Next |
The DTWAIN_EnumOCRInterfaces function returns the available supported OCR interfaces that are installed.
DTWAIN_BOOL DTWAIN_EnumOCRInterfaces ( LPDTWAIN_ARRAY lpOCRInterfaces );
Parameters lpOCRInterfaces A pointer to a DTWAIN_ARRAY that on return will be filled with the available supported OCR interfaces.
Return Values If supported, TRUE is returned. Otherwise FALSE is returned.
Comments The DTWAIN_EnumOCRInterfaces function returns to the DTWAIN_ARRAY pointed to by lpOCRInterfaces a list of the supported OCR Interfaces. The returned DTWAIN_ARRAY is of type DTWAIN_ARRAYOCRENGINE, where each value in the DTWAIN_ARRAY is a DTWAIN_OCRENGINE handle to a particular OCR interface.
Example:
// create a DTWAIN_ARRAY that will store long values. Also, create it with room for one item. DTWAIN_ARRAY theOCRInterfaces;
// Call function to set the capability BOOL bOK = DTWAIN_EnumOCRInterfaces( &theOCRInterfaces );
if ( bOK ) { // The value was set successfully LONG nCount = DTWAIN_ArrayGetCount( theOCRInterfaces ); if ( nCount > 0 ) { // Get the first OCR engine DTWAIN_OCRENGINE curOCR; DTWAIN_ArrayGetAt( theOCRInterfaces, 0, &curOCR );
// Now we can call other OCR functions when we have the curOCR, since it is a DTWAIN_OCRHANDLE. // For example, lets get the supported caps DTWAIN_ARRAY SupportedCaps; DTWAIN_GetOCRCapValues( curOCR, DTWAIN_OCRCV_SUPPORTEDCAPS, DTWAIN_CAPGET, &SupportedCaps );
//.. // Destroy the DTWAIN_ARRAY DTWAIN_ArrayDestroy( SupportedCaps ); } DTWAIN_ArrayDestroy( theOCRInterfaces ); }
Prerequisite Function Call(s) |