Home › Forums › TWAIN Classic › OpenTwain
- This topic has 3 replies, 3 voices, and was last updated 16 years, 2 months ago by gabe.
- AuthorPosts
I’ve downloaded this from http://www.codeplex.com/opentwain and it looks pretty good.
I try to run/debug GuiHarness, and want to tweak the profile and get the message “Profiles not supported” – this device doesn’t seem to support a required capability EnableDsUiOnly.
Is there anyway I can change DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDSUIONLY from within the GuiHarness?
After all that: looking in the Output window, I get Setcapability Icap_ImageFileFormat failure. I somehow suspect the scanner I am using is not upto the job.
On the identity window I get Protocol Major = 1, Minor = 8,
then version Major= 7 and Minor = 0, so is that Twain 1.8 which doesn’t support MSG_ENABLEDSUIONLY.I’ve got another, more recent scanner to play with. After all that…
@ZiggyShort wrote:
…so is that Twain 1.8 which doesn’t support MSG_ENABLEDSUIONLY.
Search for MSG_ENABLEDSUIONLY in TWAIN spec. 1.8 and you’ll find this:
MSG_ENABLEDSUIONLY – this operation is only required for mid- and high-volume scanners. It is strongly recommended for other devices…
@ZiggyShort wrote:
Is there anyway I can change DG_CONTROL / DAT_USERINTERFACE / MSG_ENABLEDSUIONLY from within the GuiHarness?
no, but the guiharness is just (a sample) showing one way of controling a device via twain – using customDsData and EnableDsUiOnly to let the device provide you with a string of data containing all of the parameters for an acquire without you manipulating caps one my one.
you’re more than welcome to drop the code that uses enableDsUiOnly and manipulate the caps one-by-one.
also there are devices that don’t support enableDsUiOnly the way that I thought they would and you may find that more devices are compatable with that sample if you update the method Update_EnableDsUiOnly in cTwain.vb from:
If OperationTriplets.Control.Capability.GetCurrentValue(Enumerations.Capability.Cap_CustomData) = "True" Then
If OperationTriplets.Control.Capability.GetCurrentValue(Enumerations.Capability.Cap_UiControllable) = "True" Then
If OperationTriplets.Control.Capability.GetCurrentValue(Enumerations.Capability.Cap_EnableDsUiOnly) = "True" Then
EnableDsUiOnly_Supported = True
to
If OperationTriplets.Control.Capability.GetCurrentValue(Enumerations.Capability.Cap_CustomDsData) = "True" OrElse _
OperationTriplets.Control.Capability.GetValue(Enumerations.Capability.Cap_CustomDsData) = "True" OrElse _
OperationTriplets.Control.Capability.GetDefaultValue(Enumerations.Capability.Cap_CustomDsData) = "True" Then
If OperationTriplets.Control.Capability.GetCurrentValue(Enumerations.Capability.Cap_UiControllable) = "True" OrElse _
OperationTriplets.Control.Capability.GetValue(Enumerations.Capability.Cap_UiControllable) = "True" OrElse _
OperationTriplets.Control.Capability.GetDefaultValue(Enumerations.Capability.Cap_UiControllable) = "True" Then
If OperationTriplets.Control.Capability.GetCurrentValue(Enumerations.Capability.Cap_EnableDsUiOnly) = "True" OrElse _
OperationTriplets.Control.Capability.GetValue(Enumerations.Capability.Cap_EnableDsUiOnly) = "True" OrElse _
OperationTriplets.Control.Capability.GetDefaultValue(Enumerations.Capability.Cap_EnableDsUiOnly) = "True" Then
as some devices reported their support for the required capabilites with msg_get and other reported their support support with msg_getCurrent or msg_getDefault.
but even then some devices still don’t support the 3 required capabilities and while I would try to avoid those devices for production use if it can’t be avoided… well then it can’t be avoided but you’ll be in for a load of work if you you’re looking to provide an consistant, automated scanning process without user interaction.
.
- AuthorPosts