Home › Forums › TWAIN Classic › TW_ENUMERATION container › Reply To: TW_ENUMERATION container
May 11, 2009 at 3:46 pm #24907
The code works because ItemList is defined as an array of TW_UINT8, but an enumeration or array can store different types. In the example it is TWTY_UINT16 which is twice the size of TW_UINT8, hence the *2.
A better way would be to casting the address of ItemList to the stored type and then indexing that.
case TWTY_UINT16:
valueU16 = ((pTW_UINT16)(&pvalEnum->ItemList))[index];
break;
Jim Watters