L_TwainCancelAcquire

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainCancelAcquire(hSession);

HTWAINSESSION hSession;

/* handle to an existing TWAIN session */

Cancels the current acquire operation.

Parameter

Description

hSession

Handle to an existing TWAIN session. This handle is obtained by calling the L_TwainInitSession function.

Returns

SUCCESS

The function was successful.

! = SUCCESS

An error occurred.  Refer to Return Codes.

Comments

Cancels the current acquire operation.

To cancel the acquire operation call this function inside the LTWAINACQUIRECALLBACK which is called by the L_TwainAcquireMulti function, or call this function inside the LTWAINBITMAPCALLBACK which is called by the L_TwainAcquire function.

Required DLLs and Libraries

LTTWN

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:

L_TwainAcquire, L_TwainAcquireMulti, L_TwainFastAcquire

Topics:

How to Acquire from the TWAIN Source

 

TWAIN Functionality: Property Functions

Example

static L_INT EXT_CALLBACK BmpCB(HTWAINSESSION hSession,
                                pBITMAPHANDLE pBitmap,
                                L_VOID     * pUserData)
{
   UNREFERENCED_PARAMETER(pBitmap);
   UNREFERENCED_PARAMETER(pUserData);

   L_TwainCancelAcquire(hSession);
   return SUCCESS;
}

 L_INT TwainCancelAcquireExample(pBITMAPHANDLE pBitmap,HTWAINSESSION g_hSession) 
{
   L_INT nRet;
   nRet = L_TwainAcquire(g_hSession,
                         pBitmap,
                         sizeof(BITMAPHANDLE),
                         BmpCB,
                         LTWAIN_SHOW_USER_INTERFACE,
                         NULL,
                         NULL);
   if (nRet == SUCCESS)
      MessageBox(NULL, TEXT("The image acquisition process completed."), TEXT("Notice"), MB_OK);
   else
   {
      MessageBox(NULL, TEXT(" The image acquisition process failed!"), TEXT("Error"), MB_OK);
      return nRet;
   }
   return SUCCESS;
}