Difference Between DTWAIN_ARRAY and LPDTWAIN_ARRAY
There are many DTWAIN functions that take a DTWAIN_ARRAY argument, or take an LPDTWAIN_ARRAY argument. The differences are very important.
For functions that take a DTWAIN_ARRAY argument, it is the responsibility of the application to initialize the DTWAIN_ARRAY correctly and place values within the array (an example of this function is DTWAIN_SetCapValue).
An LPDTWAIN_ARRAY is a pointer to a DTWAIN_ARRAY type. The application only has to declare a DTWAIN_ARRAY variable, and pass the address of the variable to the DTWAIN function. There is no need to initialize or store values in the array. An example of this is DTWAIN_GetCapValues. For LPDTWAIN_ARRAY's, DTWAIN takes the passed address, creates the array internally and stores the DTWAIN_ARRAY at the address passed. It is still the responsibility of the application to destroy this array (unless DTWAIN_SysDestroy is called, which destroys all DTWAIN_ARRAYs). |