Information on Custom Capabilities
Some Sources also support custom capabilities. These capabilities are defined by the manufacturer of the device. If your application decides to use custom capabilities, you must have prior knowledge as to how and when the capability is to be used. The custom capabilities have values that are greater than or equal to 32,768. DTWAIN DLL supports setting and getting values from custom capabilities.
If you have full information on the custom capability in terms of number, container type to use, data type to use, etc. use the DTWAIN_GetCapValuesEx2 and DTWAIN_SetCapValuesEx2. If you do not have full information on the custom capability, the capability may or may not be set correctly, so it is always best to have full documentation from the manufacturer or TWAIN driver author for the capabilities you're attempting to retrieve or set. In addition, before selecting Sources that may have custom capabilities, it is highly recommended that the DTWAIN_GetCapOperations function is called. The reason for this is that for most (if not all) Sources that define custom capabilities, the Source has also defined what operations are possible with these capabilities (these operations are getting the capability, setting the capability and resetting to the default value). For example, a custom capability may be able to be "read" but not "set". The TWAIN Sources will (or should) have this information.
By default, DTWAIN will not query the TWAIN Source for what operations are possible with capabilities for the following reasons:
For all other capabilities other than custom capabilities, the TWAIN specfification outlines exactly what the capability can perform. However, for custom capabilities, DTWAIN has no idea what operations the custom capability can perform without either making an educated guess, or actually querying the source for the information. Therefore it is highly suggested that your application calls DTWAIN_GetCapOperations so that DTWAIN will not have to "guess" the capability operations for custom capabilities.
The other option wthout calling DTWAIN_SetQueryCapSupport is to set the QUERYSUPPORT key in the DTWAIN32.INI file. This automatically turns on the support for querying the Source for capability operations. |