LTwain::GetSources

Summary

Gets the available information for the TWAIN sources installed on the system.

Syntax

#include "ltwrappr.h"

virtual L_INT LTwain::GetSources (uFlags, uStructSize)

Parameters

L_UINT uFlags

Flags that indicate what sources to get.  Possible values are:

Value Meaning
LTWAIN_SOURCE_ENUMERATE_ALL [0x0000] Enumerates all the available sources.
LTWAIN_SOURCE_ENUMERATE_DEFAULT [0x0001] Gets only the default source (currently selected).

L_UINT uStructSize

Size of the LTWAINSOURCEINFO structure, in bytes, for versioning. Use sizeof(LTWAINSOURCEINFO).

Returns

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

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT CMyTwain::SourceInfoCallBack(pLTWAINSOURCEINFO pSourceInfo) 
{ 
   L_TCHAR szBuffer[MAX_PATH]; 
 
   memset(szBuffer, 0, sizeof(szBuffer)); 
 
   wsprintf(szBuffer, TEXT("Source Name = %s\nProduct Family = %s\nManufacturer = %s\n"), 
            pSourceInfo->pszTwnSourceName, 
            pSourceInfo->pszTwnProductFamily, 
            pSourceInfo->pszTwnManufacturer); 
 
   MessageBox(NULL, szBuffer, TEXT("Source Info."), MB_OK); 
 
   return TWAIN_SUCCESS; 
} 
 
// initialize session and call this function  
 
L_INT LTwain__GetSourcesExample(CMyTwain *MyClass) 
 
{ 
   L_INT nRet;  
 
   MyClass->EnableCallBack (TRUE); 
 
   nRet = MyClass->GetSources(LTWAIN_SOURCE_ENUMERATE_ALL , sizeof(LTWAINSOURCEINFO));  
 
   if (nRet != SUCCESS) 
   { 
      MessageBox (NULL, TEXT("Error during the enumeration procedure"), TEXT("ERROR"), MB_OK);  
 
      return nRet; 
   } 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.