Quantcast
Channel: Saraff.Twain.NET
Viewing all articles
Browse latest Browse all 419

New Post: InvalidCastException when retrieving SupportedCaps capability

$
0
0
Hello, jruizaranguren.
I think you mistaken, because a DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT operation must return a bit flags value of a TWQC_xxxx.
Bellow you can see result of DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT (for CAP_SUPPORTEDCAPS) operation for a "TWAIN FreeImage Software Scanner" (from a Twacker).
ItemType=TWTY_INT32
Item=TWQC_GET |TWQC_GETDEFAULT |TWQC_GETCURRENT 

DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT

Description

Returns the Source’s support status of this capability.

Application

Set the pCapability fields as follows:
pCapability->Cap = the CAP_xxxx or ACAP_xxxx or ICAP_xxxx identifier
pCapability->ConType = TWON_ONEVALUE
pCapability->hContainer = NULL
The Source will allocate the memory for the necessary container structure but the application
must free it when the operation is complete and the application no longer needs to maintain the
information.
Use MSG_QUERYSUPPORT:
  • To check the whether the Source supports a particular operation on the capability.
This operation may fail for a low memory condition. Either recover from a
TWCC_LOWMEMORY failure by freeing memory for the Source to use so it can continue, or
terminating the acquisition and notifying the user of the low memory problem.

Source

Fill the fields in pCapability as follows:
pCapability->ConType = TWON_ONEVALUE
pCapability->hContainer = TW_HANDLE referencing a container of type TW_ONEVALUE.
TWAIN 1.9 Specification 7-151

Viewing all articles
Browse latest Browse all 419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>