LTwain::SetTransferOptions

#include "ltwrappr.h"

L_INT LTwain::SetTransferOptions(pTransferOpts);

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

Parameters

pTRANSFEROPTIONS pTransferOpts

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

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

To obtain the current transfer options, call the LTwain::GetTransferOptions function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LTwain__SetTransferOptionsExample(LTwain * plTwain) 
 
{ 
   L_INT nRet = SUCCESS;  
 
   L_UINT TransferModes = 0;  
 
   nRet = plTwain->GetSupportedTransferMode (&TransferModes);  
 
   if (nRet == SUCCESS)  
 
   { 
 
      if ((TransferModes & TWAIN_TRANSFER_FILE) == TWAIN_TRANSFER_FILE)  
 
         MessageBox(NULL, TEXT("File transfer is supported"), TEXT("Notice!"), MB_OK);  
 
   } 
   else 
      return nRet; 
 
   TRANSFEROPTIONS TransOpts;  
 
   memset(&TransOpts, 0, sizeof(TRANSFEROPTIONS));  
 
   plTwain->GetTransferOptions (&TransOpts, sizeof(TRANSFEROPTIONS));  
 
   if (nRet == SUCCESS)  
 
   { 
 
      if (TransOpts.TransferMode != TWAIN_TRANSFER_FILE)  
 
      { 
 
         TransOpts.TransferMode = TWAIN_TRANSFER_FILE;  
 
         lstrcpy(TransOpts.szFileName, MAKE_IMAGE_PATH(TEXT("test.bmp"))); 
 
         TransOpts.uFileFormat = TWFF_BMP;  
 
      } 
 
      nRet = plTwain->SetTransferOptions(&TransOpts);  
      if(nRet != SUCCESS) 
         return nRet; 
 
   } 
 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help