L_TwainSetTransferOptions

#include "lttw2.h"

L_INT EXT_FUNCTION L_TwainSetTransferOptions(hSession, pTransferOpts)

HTWAINSESSION hSession;

/* handle to an existing TWAIN session */

pTRANSFEROPTIONS pTransferOpts;

/* pointer to a structure */

Sets the options used for transferring data from the current TWAIN source.

Parameter

Description

hSession

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

pTransferOpts

Pointer to the TRANSFEROPTIONS structure that contains the transfer options to set.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

To obtain the current transfer options, call L_TwainGetTransferOptions function.

This function should be called after calling the L_TwainStartCapsNeg function and before calling the L_TwainEndCapsNeg 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_TwainGetTransferOptions, L_TwainGetSupportedTransferMode, L_TwainSetResolution, L_TwainGetResolution, L_TwainSetImageFrame, L_TwainGetImageFrame, L_TwainSetImageUnit, L_TwainGetImageUnit, L_TwainSetImageBitsPerPixel, L_TwainGetImageBitsPerPixel, L_TwainSetImageEffects, L_TwainGetImageEffects, L_TwainSetAcquirePageOptions, L_TwainGetAcquirePageOptions, L_TwainSetRGBResponse, L_TwainShowProgress, L_TwainEnableDuplex, L_TwainGetDuplexOptions, L_TwainSetMaxXferCount, L_TwainGetMaxXferCount

Topics:

Getting and Setting Capabilities

 

TWAIN Functionality: Capability Functions

Example

void TestTransferOptions(HTWAINSESSION hSession)
{
   L_INT nRet = SUCCESS; 

   L_TwainStartCapsNeg (hSession); 

   L_UINT TransferModes = 0; 
   nRet = L_TwainGetSupportedTransferMode (hSession, &TransferModes); 
   if (nRet == SUCCESS) 
   {
      if ((TransferModes & TWAIN_TRANSFER_FILE) == TWAIN_TRANSFER_FILE) 
         MessageBox(NULL, TEXT("File transfer is supported"), TEXT("Notice!"), MB_OK); 
   }

   TRANSFEROPTIONS TransOpts; 
   memset(&TransOpts, 0, sizeof(TRANSFEROPTIONS)); 
   L_TwainGetTransferOptions (hSession, &TransOpts, sizeof(TRANSFEROPTIONS)); 
   if (nRet == SUCCESS) 
   {
      if (TransOpts.TransferMode != TWAIN_TRANSFER_FILE) 
      {
         TransOpts.TransferMode = TWAIN_TRANSFER_FILE; 
         strcpy(TransOpts.szFileName, TEXT("c:\\test.bmp"));
         TransOpts.uFileFormat = TWFF_BMP; 
      }

      L_TwainSetTransferOptions(hSession, &TransOpts); 
   }

   L_TwainEndCapsNeg(hSession); 
}