DTWAIN_ArrayInsertAtWideStringN

Top  Previous  Next

The DTWAIN_ArrayInsertAtWideStringN inserts N copies of a wide (16-bit character) string into a DTWAIN_ARRAY.

 

DTWAIN_BOOL DTWAIN_ArrayInsertAtWideStringN (

DTWAIN_ARRAY

Array

LONG

Index,

LPCWSTR

Value, 

LONG

NumCopies

 

Parameters

Array

DTWAIN_ARRAY that the values will be inserted into.

 

Index

Position to place the inserted values

 

Value

A pointer to a null-terminated wide string to insert.


NumCopies

Number of copies of Value to add to the array.

 

Return Values

TRUE if successful, FALSE otherwise.  If the function returns FALSE, call DTWAIN_GetLastError() to get extended information.

  

Comments

The DTWAIN_ArrayInsertAtWideStringN inserts NumCopies of the contents of the buffer located at Value before position Index of the DTWAIN_ARRAY Array.  The number of elements in the DTWAIN_ARRAY is increased by NumCopies.  


The Index is a 0-based index value, i.e.  to insert values at the beginning of the array, the value of Index would be 0.


This function will only work for DTWAIN_ARRAY's that can store string values (i.e. the DTWAIN_ARRAY was created with the DTWAIN_ARRAYWIDESTRING style, or created with DTWAIN_ARRAYSTRING style for Unicode builds of DTWAIN (dtwain32u.dll, dtwain64u.dll). See DTWAIN_ArrayCreate for more information)

 

It is the responsibility of the application to store the correct string type (ANSI / Unicode) in the string array.  For example, if your application attempts to store char-based (ANSI) strings in a DTWAIN_ARRAY that was created to take wide (Unicode) strings, DTWAIN has no way of checking if the string is of the correct type, thus your application will more than likely not behave correctly when attempting to access the strings within the array.

 
To insert 8-bit (ANSI) character strings, use DTWAIN_ArrayInsertAtAnsiStringN.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

See Also

Adding, Setting, and Inserting elements in a DTWAIN_ARRAY