Forums › TWAIN Classic › OpenTwain › Re: Re: OpenTwain
@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.
.