L_TwainSetCustomDSData

#include "l_bitmap.h"

L_LTTWN_API L_INT EXT_FUNCTION L_TwainSetCustomDSData(hSession, pCustomData, pszFileName)

HTWAINSESSION hSession;

/* handle to an existing TWAIN session */

pTW_CUSTOMDSDATA pCustomData;

/* pointer to TW_CUSTOMDSDATA structure to be filled */

L_TCHAR * pszFileName;

/* file name contains custom data to set */

Sets the custom data of TWAIN data source.

This feature is available in version 16 or higher.

Parameter

Description

hSession

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

pCustomData

Pointer to a TW_CUSTOMDSDATA structure. This structure must be allocated and contains the custom data of TWAIN data source to set. Pass NULL if you need set data from file.

pszFileName

Character string that contains a file name for the custom data of valid TWAIN data source to load from. Pass NULL to set the data using the pCustomData.

Returns

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 get the custom data of TWAIN data source, call the L_TwainGetCustomDSData function.

To load the custom data of TWAIN data source from a file, pass valid file name to pszFileName and NULL to pCustomData.

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_TwainSetCustomDSData, L_TwainGetCapability, L_TwainSetCapability

Topics:

Getting and Setting Capabilities

 

TWAIN Functionality: Capability Functions

Example

 L_INT TwainSetCustomDSDataExample(HTWAINSESSION hSession, L_TCHAR * pszFileName)
{
   L_TwainStartCapsNeg(hSession);
   L_INT nRet;

   nRet = L_TwainSetCustomDSData(hSession, NULL, pszFileName);
   if (nRet != SUCCESS) 
   {
      MessageBox (NULL, TEXT("Failed to set custom data source data"), TEXT("ERROR"), MB_OK);
      return nRet;
   }

   L_TwainEndCapsNeg(hSession);
   return SUCCESS;
}