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

New Post: InvalidCastException when retrieving SupportedCaps capability

$
0
0
Hello, jruizaranguren.
According to the specification, the operation DG_CONTROL / DAT_CAPABILITY / MSG_QUERYSUPPORT must return the container of a TWON_ONEVALUE type.

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.
Fill the fields in TW_ONVALUE as follows:
  1. ItemType = TWTW_INT32;
  2. Item = Bit pattern representing the set of operation that are supported by the Data Source on
    this capability (TWQC_GET, TWQC_SET, TWQC_GETCURRENT, TWQC_GETDEFAULT,
    TWQC_RESET, TWQC_SETCONSTRAINT, TWQC_CONSTRAINABLE);
TWAIN 2.2 Specification 7-25


Moreover, in the CAP_SUPPORTEDCAPS description specified that the MSG_QUERYSUPPORT operation must return the TW_ONEVALUE.

CAP_SUPPORTEDCAPS

Description

Containers

  • MSG_GET: TW_ARRAY
  • MSG_GETCURRENT: TW_ARRAY
  • MSG_GETDEFAULT: TW_ARRAY
  • MSG_SET: Not Allowed
  • MSG_SETCONSTRAINT: Not Allowed
  • MSG_RESET: Not Allowed
  • MSG_QUERYSUPPORT: TW_ONEVALUE
TWAIN 2.2 Specification 10-91


Thus, the problem in the HP Scanjet 8200 scanner driver.

Viewing all articles
Browse latest Browse all 419

Trending Articles



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