L_TwainGetCustomDSData

#include "lttwn.h"

L_LTTWN_API L_INT EXT_FUNCTION L_TwainGetCustomDSData(hSession, pCustomData, pszFileName)

Gets the custom data of a TWAIN data source and saves it to a file.

This feature is available in version 16 or higher.

Parameters

HTWAINSESSION hSession

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

pTW_CUSTOMDSDATA pCustomData

Pointer to a TW_CUSTOMDSDATA structure. This structure must be allocated and it will be filled with custom data source data. For more information, refer to the TWAIN specification.

L_TCHAR * pszFileName

Character string that contains file name to save the custom data of TWAIN data source to. Pass NULL to not save the data to a file.

Returns

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

Comments

This function should be called after calling the L_TwainStartCapsNeg function and before calling the L_TwainEndCapsNeg function.

To update the custom data of a TWAIN data source, call the L_TwainSetCustomDSData function.

To save the custom data of TWAIN data source to a file, pass a valid file name to pszFileName. If you pass NULL, the data will return only to pCustomData. Also, you should pass valid pointer to TW_CUSTOMDSDATA to pCustomData.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT TwainGetCustomDSDataExample(HTWAINSESSION hSession, L_TCHAR * pszFileName) 
{ 
   L_TwainStartCapsNeg(hSession); 
   L_INT nRet; 
   TW_CUSTOMDSDATA twData; 
 
   memset(&twData, 0, sizeof(TW_CUSTOMDSDATA)); 
 
   nRet = L_TwainGetCustomDSData(hSession, &twData, pszFileName); 
   if (nRet != SUCCESS)  
   { 
      MessageBox (NULL, TEXT("Failed to get custom data source data"), TEXT("ERROR"), MB_OK); 
      return nRet; 
   } 
 
   L_TwainEndCapsNeg(hSession); 
   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 API Help