DTWAIN_ArraySetAtANSIString

Top  Previous  Next

The DTWAIN_ArraySetAtANSIString places a wide (Unicode)string element in a DTWAIN_ARRAY.

 

DTWAIN_BOOL DTWAIN_ArraySetAtANSIString (

DTWAIN_ARRAY

Array

LONG

Index

LPCSTR

Value );

 

Parameters

Array

DTWAIN_ARRAY that the value will be placed.

 

Index

Position to place the element

 

Value

Pointer to string to be set in the DTWAIN_ARRAY.

 

Return Values

If the function succeeds, TRUE is returned.  If the function fails FALSE is returned.

 
 

Comments

DTWAIN_ArraySetAtANSIString is a specialized version of DTWAIN_ArraySetAt.

 

The DTWAIN_ArraySetAtANSIString copies the string pointed to by Value to a position in the DTWAIN_ARRAY Array.   The Index argument is the position to place the value, and must be in the range of 0 to n-1 where n is the number of elements in the array.   The string must be a null-terminated string.

 

Unlike DTWAIN_ArrayInsertAtANSIString, the DTWAIN_ArraySetAtANSIString function replaces the value located at the position instead of inserting the value and moving existing elements down.

 

This function will only work for DTWAIN_ARRAY's that can store 8-bit ANSI character strings.  The DTWAIN_ARRAY must be created  with

 

1) The DTWAIN_ARRAYANSISTRING style

or

2) with the DTWAIN_ARRAYSTRING style if using the Unicode version of the DTWAIN library (DTWAIN32.DLL, DTWAIN64.DLL).

 

To insert 16-bit (Unicde) character strings, use DTWAIN_ArraySetAtWideString.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

See Also

Adding, Setting, and Inserting elements in a DTWAIN_ARRAY