Home › Forums › TWAIN Classic › CAP_FEEDERENABLED expected behavior
- This topic has 4 replies, 2 voices, and was last updated 10 years, 5 months ago by xdaiana.
- AuthorPosts
Hello,
I need some help in understanding the expected behavior in the following situation:
– the application sets CAP_FEEDERENABLED = true (if I understand well that means the driver HAS TO scan from the ADF and not from flatbed)
– data source was enabled with ShowUI = false
– there is no paper in the ADFWhat is the driver supposed to do (in both CAP_INDICATORS true or false)?
a) show an error message (MessageBox) asking if the user wants to scan from flatbed
b) silently scan from flatbed
c) return an errorThank you
Hi xdaiana,
If you are developing a DS, it’s best to prompt the user to load the feeder. Then start the scan if they click “OK” with paper loaded or return an error if they click “Cancel”. CAP_INDICATORS only controls progress indicators; it is not relevant in this situation. Please see the section in the specification titled “Error and Device Control Indicators”.
If you are developing an application and would prefer to avoid this situation, check CAP_FEEDERLOADED before enabling the DS.
—Sorry, I forgot to specify: Yes, I am developing a DS.
I mentioned CAP_INDICATORS because the specs say if this one is false and ShowUI also, then the driver should not show any UI elements on its own. Means possibility a) is not acceptable under this circumstances.“If the Source user interface is not displayed, and the Application sets CAP_INDICATORS to FALSE, then the Source is not allowed to display any kind of user interface, progress indicator or error dialog. All UI activity must be suppressed.“
When the UI is shown, then I also think that prompting the user is the best option.
Thanks,
DaianaHi Daiana,
That’s interesting. I did some digging. Here’s what I’ve found.
TWAIN spec 2.1 says:
While the Source’s user interface is raised, the Source is responsible for presenting the user with appropriate progress indicators regarding the acquisition and transfer processes unless the application has set CAP_INDICATORS to FALSE. The Source must also report errors to the user (without regard for the settings of CAP_INDICATORS and ShowUI, i.e. they may be set to FALSE and errors still must be reported)
My emphasis added.
I was going on that information but, as you pointed out, spec 2.2 says:
If the Source user interface is not displayed, and the Application sets CAP_INDICATORS to FALSE, then the Source is not allowed to display any kind of user interface, progress indicator or error dialog. All UI activity must be suppressed.
This very recent change to the spec makes your original question a good one. In the case of an empty feeder, it looks like MSG_ENABLEDS should return TWRC_FAILURE/TWCC_NOMEDIA. But what if showUI is FALSE, CAP_INDICATORS is FALSE, and some other device error occurs? Perhaps return TWRC_FAILURE/TWCC_OPERATIONERROR even though the DS did not handle the error.
That’s my interpretation of the spec. Anyone else care to weigh in on this?
—Thank you. I didn’t read the 2.1 specs, only the 2.2 ones. At least that means the DS is standard compliant (it has the message box asking for paper in ADF), but not 2.2.
- AuthorPosts