L_DocSetProgressCB
#include "ltdoc.h"
L_INT EXT_FUNCTION L_DocSetProgressCB(hDoc, pfnCallback, pUserData)
L_HDOC hDoc; |
/* handle to the OCR document */ |
PROGRESSCALLBACK pfnCallback; |
/* callback function */ |
/* pointer to more parameters for the callback */ |
Sets the progress callback function that should be used by the OCR engine to report progress and offer the client the chance to cancel.
Parameter |
Description |
hDoc |
Handle to the OCR document |
pfnCallback |
Optional callback function for reporting progress of a specific operation. |
|
If you do not provide a callback function, use NULL as the value of this parameter. Use NULL if no progress reporting is needed. If you do provide a callback function, use the function pointer as the value of this parameter. |
|
The OCR engine calls this callback function as it reports the progress of a specific operation. |
|
The callback function must adhere to the following function prototype: PROGRESSCALLBACK. |
pUserData |
Void pointer that you can use to pass one or more additional parameters that the callback function needs. |
|
To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer to the appropriate data type to access your variable or structure. |
|
If the additional parameters are not needed, you can pass NULL in this parameter. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
To get the current process, check the Id member of the PROGRESSDATA structure, which is passed to the PROGRESSCALLBACK function.
Refer to the OCRPROCID enum for the event types that can be reported to the progress callback.
Required DLLs and Libraries
LTDOC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
|
Topics: |
|
|
Example
L_BOOL EXT_CALLBACK ProgressFunction(pPROGRESSDATA pProgressData, L_VOID L_FAR * pUserData)
{
if (pProgressData->Id == PROC_FIND_ZONES)
MessageBox(NULL, TEXT("The current process is finding zones in a specific page."), TEXT("Notice!"), MB_OK);
//...
//... Your code here
//...
return TRUE;
}
void TestProgressFunction(L_HDOC hDoc)
{
L_DocSetProgressCB(hDoc, ProgressFunction, NULL);
}