Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
L_WiaEnumFormats
#include "ltwia.h"
L_LTWIA_API L_INT EXT_FUNCTION L_WiaEnumFormats(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 */ |
LWIAENUMFORMATSCALLBACK pfnCallBack; |
/* pointer to callback function */ |
L_VOID * pUserData; |
/* pointer to additional parameters */ |
Enumerates all of the available WIA driver transfer formats.
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 format is received from the driver along with the transfer mode this format is associated with. It also allows the user to abort the enumeration process. |
|
The callback function must adhere to the function prototype described in LWIAENUMFORMATSCALLBACK 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 transfer formats for the specified acquisition source item.
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
Earlier and later operating systems than Windows XP for WIA Version 1.
Windows VISTA or later for WIA Version 2.
See Also
Functions: |
L_WiaEnumCapabilities, L_WiaInitSession, L_WiaEndSession, LWIAENUMFORMATSCALLBACK. |
Topics: |
|
|
|
|
Example
static L_INT CALLBACK WiaEnumFormatsCB(HWIASESSION hSession, L_INT nFormatsCount, L_INT nTransferMode, GUID * pFormat, L_VOID * pUserData) { UNREFERENCED_PARAMETER(hSession); UNREFERENCED_PARAMETER(nFormatsCount); UNREFERENCED_PARAMETER(nTransferMode); UNREFERENCED_PARAMETER(pFormat); UNREFERENCED_PARAMETER(pUserData); // You can do here any kind of checking or handling to the received format. return WIA_SUCCESS; } L_LTWIATEX_API L_INT WiaEnumFormatsExample(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_WiaEnumFormats(hSession, pRootItem, 0, WiaEnumFormatsCB, NULL); if (nRet != WIA_SUCCESS) return FALSE; return SUCCESS; }