L_WiaEnumCapabilities

#include "ltwia.h"

L_LTWIA_API L_INT EXT_FUNCTION L_WiaEnumCapabilities(hSession, pItem, uFlags, pfnCallBack, pUserData)

HWIASESSION hSession;

handle to an existing WIA session

L_VOID* pItem;

pointer to IWiaItem or IWiaItem2 interface

L_UINT uFlags;

reserved for future use, pass 0

LWIAENUMCAPABILITIESCALLBACK pfnCallBack;

pointer to callback function

L_VOID * pUserData;

pointer to additional parameters

Enumerates all of the available WIA driver capabilities and properties and determines the available values for each one.

Parameter

Description

hSession

Handle to an existing WIA session. This handle is obtained by calling the L_WiaInitSession function.

pItem

Valid pointer to a type IWiaItem or IWiaItem2 object (IWiaItem if using WIA Version 1.0; IWiaItem2 if using WIA Version 2.0), which represents the item being enumerated.

 

You can retrieve this parameter by either calling the L_WiaGetRootItem function to get a pointer to the device's root item or by enumerating the child items of the device through a call to L_WiaEnumChildItems.

uFlags

Reserved for future use, pass 0.

pfnCallBack

Pointer to a callback function, called as each capability was received from the driver. It provides the user with information about each enumerated property such as the valid ranges and values for each of the WIA device properties. It also allows the user to abort the enumeration process.

 

The callback function must adhere to the function prototype described in LWIAENUMCAPABILITIESCALLBACK function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

 

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

 

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This feature is available in version 16 or higher.

This function will enumerate all of the available WIA driver capabilities and properties (and determine the available values for each one) for the specified acquisition source.

Required DLLs and Libraries

LTWIA

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

LEADTOOLS WIA supports both 32-bit and 64-bit image acquisition for both WIA 1.0 (XP and earlier) and WIA 2.0 (VISTA and later).

See Also

Functions:

L_WiaEnumFormats, L_WiaInitSession, L_WiaEndSession, LWIAENUMCAPABILITIESCALLBACK.

Topics:

Managing WIA Sources

 

WIA Functionality: Property Functions

 

WIA Functionality: Callbacks

Example

static L_INT CALLBACK WiaEnumCapsCB(HWIASESSION hSession, 
L_INT nCapsCount, 
pLWIACAPABILITY pCapability, 
L_VOID * pUserData) 
{ 
   UNREFERENCED_PARAMETER(hSession); 
   UNREFERENCED_PARAMETER(nCapsCount); 
   UNREFERENCED_PARAMETER(pCapability); 
   UNREFERENCED_PARAMETER(pUserData); 
   // You can do here any kind of checking or handling to the received capability. 
   return WIA_SUCCESS; 
} 
L_INT WiaEnumCapabilitiesExample(HWIASESSION hSession) 
{ 
   IWiaItem * pRootItem = NULL; 
   L_INT nRet; 
   /* Get a pointer to the WIA device's root items */ 
   nRet = L_WiaGetRootItem(hSession, NULL, (L_VOID**)&pRootItem); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_WiaEnumCapabilities(hSession, pRootItem, 0, WiaEnumCapsCB, NULL); 
   if (nRet != WIA_SUCCESS) 
      return FALSE; 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS WIA C API Help